pub trait TryFromState<T>: Sized {
// Required method
fn from<'async_trait>(
source: T,
state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Similar to TryFrom, but threads additional State in as context that is necessary to perform the conversion
Required Methods§
fn from<'async_trait>(
source: T,
state: Arc<RwLock<State>>,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.