Skip to main content

TryFromState

Trait TryFromState 

Source
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§

Source

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.

Implementations on Foreign Types§

Source§

impl TryFromState<ResponseData> for Vec<Trade>

Source§

fn from<'async_trait>( response: ResponseData, _state: Arc<RwLock<State>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trade>>> + Send + 'async_trait>>

Source§

impl TryFromState<ResponseData> for Vec<Trade>

Source§

fn from<'async_trait>( response: ResponseData, _state: Arc<RwLock<State>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trade>>> + Send + 'async_trait>>

Source§

impl TryFromState<ResponseData> for HashMap<Asset, BigDecimal>

Source§

fn from<'async_trait>( response: ResponseData, _state: Arc<RwLock<State>>, ) -> Pin<Box<dyn Future<Output = Result<HashMap<Asset, BigDecimal>>> + Send + 'async_trait>>

Implementors§