Struct Sig

Source
pub struct Sig<T>(pub T);
Expand description

Newtype wrapper to mark this type as a signal.

For use with SignalOrValue and RefSignalOrValue

Tuple Fields§

§0: T

Trait Implementations§

Source§

impl<T, S> RefSignalOrValue<'static> for Sig<S>
where T: 'static, S: Signal<Item = T> + 'static,

Source§

type Item = T

The underlying type of the value or signal.
Source§

type Map<'b, F, R> = Sig<Map<S, F>> where F: FnMut(Self::Item) -> R + 'b, R: RefSignalOrValue<'b, Item = R> + 'b, 'b: 'static

The return type for Self::map. Read more
Source§

type Signal = S

The signal type. Use Always for value types.
Source§

fn map<'b, F, R>(self, callback: F) -> Self::Map<'b, F, R>
where R: RefSignalOrValue<'b, Item = R> + 'b, F: FnMut(Self::Item) -> R + 'b, 'b: 'static,

Map a function over this signal/value to produce a new signal/value.
Source§

fn select<FVal, FSig, Data, Out>( self, _fn_val: FVal, fn_sig: FSig, data: Data, ) -> Out
where FVal: FnOnce(Data, Self::Item) -> Out, FSig: FnOnce(Data, Self::Signal) -> Out,

Select a function based on whether this is a signal or value. Read more
Source§

fn select_spawn<FVal, FSig, Task, Exec>( self, _fn_val: FVal, fn_sig: FSig, executor: &mut Exec, )
where FVal: FnOnce(&mut Exec, Self::Item), FSig: FnOnce(&mut Exec, Self::Signal) -> Task, Task: Future<Output = ()> + 'static, Exec: Executor,

Select a function based on whether this is a signal or value. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Sig<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Sig<T>
where T: RefUnwindSafe,

§

impl<T> Send for Sig<T>
where T: Send,

§

impl<T> Sync for Sig<T>
where T: Sync,

§

impl<T> Unpin for Sig<T>
where T: Unpin,

§

impl<T> UnwindSafe for Sig<T>
where T: UnwindSafe,

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

impl<T> SignalOrValue for T
where T: RefSignalOrValue<'static>,