Struct ContextWrapper

Source
pub struct ContextWrapper<'a, T, C> { /* private fields */ }
Expand description

Context wrapper, to bind an API with a context.

Implementations§

Source§

impl<'a, T, C> ContextWrapper<'a, T, C>

Source

pub fn new(api: &'a T, context: C) -> ContextWrapper<'a, T, C>

Create a new ContextWrapper, binding the API and context.

Source

pub fn api(&self) -> &T

Borrows the API.

Source

pub fn context(&self) -> &C

Borrows the context.

Trait Implementations§

Source§

impl<'a, T: Api<C>, C> ApiNoContext for ContextWrapper<'a, T, C>

Source§

fn clear_error( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = ClearErrorResponse, Error = ApiError> + Send>

Source§

fn get_addr_enabled( &self, bus_id: i32, addr: i32, num: i32, ) -> Box<dyn Future<Item = GetAddrEnabledResponse, Error = ApiError> + Send>

Source§

fn get_addr_info( &self, bus_id: i32, addr: i32, num: i32, ) -> Box<dyn Future<Item = GetAddrInfoResponse, Error = ApiError> + Send>

Source§

fn get_addr_value( &self, bus_id: i32, addr: i32, num: i32, ) -> Box<dyn Future<Item = GetAddrValueResponse, Error = ApiError> + Send>

Source§

fn get_api( &self, ) -> Box<dyn Future<Item = GetApiResponse, Error = ApiError> + Send>

Source§

fn get_config( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetConfigResponse, Error = ApiError> + Send>

Source§

fn get_current( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetCurrentResponse, Error = ApiError> + Send>

Source§

fn get_error( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetErrorResponse, Error = ApiError> + Send>

Source§

fn get_errors( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetErrorsResponse, Error = ApiError> + Send>

Source§

fn get_freq( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetFreqResponse, Error = ApiError> + Send>

Source§

fn get_group( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetGroupResponse, Error = ApiError> + Send>

Source§

fn get_led_current( &self, bus_id: i32, addr: i32, led: i32, ) -> Box<dyn Future<Item = GetLedCurrentResponse, Error = ApiError> + Send>

Source§

fn get_led_error( &self, bus_id: i32, addr: i32, led: i32, ) -> Box<dyn Future<Item = GetLedErrorResponse, Error = ApiError> + Send>

Source§

fn get_led_info( &self, bus_id: i32, addr: i32, led: i32, ) -> Box<dyn Future<Item = GetLedInfoResponse, Error = ApiError> + Send>

Source§

fn get_led_info_all( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetLedInfoAllResponse, Error = ApiError> + Send>

Source§

fn get_led_pwm( &self, bus_id: i32, addr: i32, led: i32, ) -> Box<dyn Future<Item = GetLedPwmResponse, Error = ApiError> + Send>

Source§

fn get_led_state( &self, bus_id: i32, addr: i32, led: i32, ) -> Box<dyn Future<Item = GetLedStateResponse, Error = ApiError> + Send>

Source§

fn get_offset( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetOffsetResponse, Error = ApiError> + Send>

Source§

fn get_output_change( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetOutputChangeResponse, Error = ApiError> + Send>

Source§

fn get_over_temp( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetOverTempResponse, Error = ApiError> + Send>

Source§

fn get_pwm( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetPwmResponse, Error = ApiError> + Send>

Source§

fn get_sleep( &self, bus_id: i32, addr: i32, ) -> Box<dyn Future<Item = GetSleepResponse, Error = ApiError> + Send>

Source§

fn reset( &self, bus_id: i32, ) -> Box<dyn Future<Item = ResetResponse, Error = ApiError> + Send>

Source§

fn set_addr_enabled( &self, bus_id: i32, addr: i32, num: i32, enabled: bool, ) -> Box<dyn Future<Item = SetAddrEnabledResponse, Error = ApiError> + Send>

Source§

fn set_addr_value( &self, bus_id: i32, addr: i32, num: i32, addr_val: i32, ) -> Box<dyn Future<Item = SetAddrValueResponse, Error = ApiError> + Send>

Source§

fn set_config( &self, bus_id: i32, addr: i32, config: Config, ) -> Box<dyn Future<Item = SetConfigResponse, Error = ApiError> + Send>

Source§

fn set_current( &self, bus_id: i32, addr: i32, current: i32, ) -> Box<dyn Future<Item = SetCurrentResponse, Error = ApiError> + Send>

Source§

fn set_freq( &self, bus_id: i32, addr: i32, freq: i32, ) -> Box<dyn Future<Item = SetFreqResponse, Error = ApiError> + Send>

Source§

fn set_group( &self, bus_id: i32, addr: i32, group: Group, ) -> Box<dyn Future<Item = SetGroupResponse, Error = ApiError> + Send>

Source§

fn set_led_current( &self, bus_id: i32, addr: i32, led: i32, current: i32, ) -> Box<dyn Future<Item = SetLedCurrentResponse, Error = ApiError> + Send>

Source§

fn set_led_error( &self, bus_id: i32, addr: i32, led: i32, error: LedError, ) -> Box<dyn Future<Item = SetLedErrorResponse, Error = ApiError> + Send>

Source§

fn set_led_info( &self, bus_id: i32, addr: i32, led: i32, led_info: LedInfo, ) -> Box<dyn Future<Item = SetLedInfoResponse, Error = ApiError> + Send>

Source§

fn set_led_info_all( &self, bus_id: i32, addr: i32, led_info_array: LedInfoArray, ) -> Box<dyn Future<Item = SetLedInfoAllResponse, Error = ApiError> + Send>

Source§

fn set_led_pwm( &self, bus_id: i32, addr: i32, led: i32, pwm: i32, ) -> Box<dyn Future<Item = SetLedPwmResponse, Error = ApiError> + Send>

Source§

fn set_led_state( &self, bus_id: i32, addr: i32, led: i32, state: LedState, ) -> Box<dyn Future<Item = SetLedStateResponse, Error = ApiError> + Send>

Source§

fn set_offset( &self, bus_id: i32, addr: i32, offset: i32, ) -> Box<dyn Future<Item = SetOffsetResponse, Error = ApiError> + Send>

Source§

fn set_output_change( &self, bus_id: i32, addr: i32, output_change: OutputChange, ) -> Box<dyn Future<Item = SetOutputChangeResponse, Error = ApiError> + Send>

Source§

fn set_pwm( &self, bus_id: i32, addr: i32, pwm: i32, ) -> Box<dyn Future<Item = SetPwmResponse, Error = ApiError> + Send>

Source§

fn set_sleep( &self, bus_id: i32, addr: i32, sleep: bool, ) -> Box<dyn Future<Item = SetSleepResponse, Error = ApiError> + Send>

Source§

impl<'a, T, C> Clone for ContextWrapper<'a, T, C>
where C: Clone,

Source§

fn clone(&self) -> ContextWrapper<'a, T, C>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, T, C> Debug for ContextWrapper<'a, T, C>
where T: Debug, C: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T, C> Freeze for ContextWrapper<'a, T, C>
where C: Freeze,

§

impl<'a, T, C> RefUnwindSafe for ContextWrapper<'a, T, C>

§

impl<'a, T, C> Send for ContextWrapper<'a, T, C>
where C: Send, T: Sync,

§

impl<'a, T, C> Sync for ContextWrapper<'a, T, C>
where C: Sync, T: Sync,

§

impl<'a, T, C> Unpin for ContextWrapper<'a, T, C>
where C: Unpin,

§

impl<'a, T, C> UnwindSafe for ContextWrapper<'a, T, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.