added a few old deprecated functions to help users port (#2580)

This commit is contained in:
Marc-Stefan Cassola 2024-05-07 14:19:55 +01:00 committed by Greg Johnston
parent 711175a760
commit 986fbe5328
3 changed files with 36 additions and 0 deletions

View file

@ -245,3 +245,17 @@ where
O: 'static,
{
}
#[inline(always)]
#[track_caller]
#[deprecated = "This function is being removed to conform to Rust \
idioms.Please use `Action::new()` instead."]
pub fn create_action<I, O, F, Fu>(action_fn: F) -> Action<I, O>
where
I: Send + Sync + 'static,
O: Send + Sync + 'static,
F: Fn(&I) -> Fu + Send + Sync + 'static,
Fu: Future<Output = O> + Send + 'static,
{
Action::new(action_fn)
}

View file

@ -110,3 +110,14 @@ impl ToAnySubscriber for Effect {
.expect("tried to subscribe to effect that has been stopped")
}
}
#[inline(always)]
#[track_caller]
#[deprecated = "This function is being removed to conform to Rust \
idioms.Please use `Effect::new()` instead."]
pub fn create_effect<T>(mut fun: impl FnMut(Option<T>) -> T + 'static) -> Effect
where
T: 'static,
{
Effect::new(fun)
}

View file

@ -258,6 +258,17 @@ where
}
}
#[inline(always)]
#[track_caller]
#[deprecated = "This function is being removed to conform to Rust \
idioms.Please use `StoredValue::new()` instead."]
pub fn store_value<T>(value: T) -> StoredValue<T>
where
T: Send + Sync + 'static,
{
StoredValue::new(value)
}
#[doc(hidden)]
pub trait StoredData {
type Data;