Struct Props

Source
pub struct Props(/* private fields */);

Implementations§

Source§

impl Props

Source

pub fn new<T>(data: T) -> Props
where T: 'static + PropsData,

Source

pub fn is_empty(&self) -> bool

Source

pub fn has<T>(&self) -> bool
where T: 'static + PropsData,

Source

pub fn remove<T>(&mut self)
where T: 'static + PropsData,

Source

pub fn consume<T>(&mut self) -> Result<Box<dyn PropsData>, PropsError>
where T: 'static + PropsData,

Source

pub fn consume_unwrap_cloned<T>(&mut self) -> Result<T, PropsError>
where T: 'static + PropsData + Clone,

Source

pub fn read<T>(&self) -> Result<&T, PropsError>
where T: 'static + PropsData,

Source

pub fn map_or_default<T, R, F>(&self, f: F) -> R
where T: 'static + PropsData, R: Default, F: FnMut(&T) -> R,

Source

pub fn map_or_else<T, R, F, E>(&self, f: F, e: E) -> R
where T: 'static + PropsData, F: FnMut(&T) -> R, E: FnMut() -> R,

Source

pub fn read_cloned<T>(&self) -> Result<T, PropsError>
where T: 'static + PropsData + Clone,

Source

pub fn read_cloned_or_default<T>(&self) -> T
where T: 'static + PropsData + Clone + Default,

Source

pub fn read_cloned_or_else<T, F>(&self, f: F) -> T
where T: 'static + PropsData + Clone + Default, F: FnMut() -> T,

Source

pub fn write<T>(&mut self, data: T)
where T: 'static + PropsData,

Source

pub fn mutate<T, F>(&mut self, f: F)
where T: 'static + PropsData, F: FnMut(&T) -> T,

Source

pub fn mutate_cloned<T, F>(&mut self, f: F)
where T: 'static + PropsData + Clone, F: FnMut(&mut T),

Source

pub fn mutate_or_write<T, F, W>(&mut self, f: F, w: W)
where T: 'static + PropsData, F: FnMut(&T) -> T, W: FnMut() -> T,

Source

pub fn with<T>(self, data: T) -> Props
where T: 'static + PropsData,

Source

pub fn without<T>(self) -> Props
where T: 'static + PropsData,

Source

pub fn merge(self, other: Props) -> Props

Source

pub fn merge_from(&mut self, other: Props)

Trait Implementations§

Source§

impl Clone for Props

Source§

fn clone(&self) -> Props

Returns a copy 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 Debug for Props

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Props

Source§

fn default() -> Props

Returns the “default value” for a type. Read more
Source§

impl From<&Props> for Props

Source§

fn from(data: &Props) -> Props

Converts to this type from the input type.
Source§

impl<A> From<(A,)> for Props
where A: PropsData,

Source§

fn from(_: (A,)) -> Props

Converts to this type from the input type.
Source§

impl<A, B> From<(A, B)> for Props
where A: PropsData, B: PropsData,

Source§

fn from(_: (A, B)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C> From<(A, B, C)> for Props
where A: PropsData, B: PropsData, C: PropsData,

Source§

fn from(_: (A, B, C)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D> From<(A, B, C, D)> for Props
where A: PropsData, B: PropsData, C: PropsData, D: PropsData,

Source§

fn from(_: (A, B, C, D)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E> From<(A, B, C, D, E)> for Props
where A: PropsData, B: PropsData, C: PropsData, D: PropsData, E: PropsData,

Source§

fn from(_: (A, B, C, D, E)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F> From<(A, B, C, D, E, F)> for Props

Source§

fn from(_: (A, B, C, D, E, F)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G> From<(A, B, C, D, E, F, G)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H> From<(A, B, C, D, E, F, G, H)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I> From<(A, B, C, D, E, F, G, H, I)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J> From<(A, B, C, D, E, F, G, H, I, J)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K> From<(A, B, C, D, E, F, G, H, I, J, K)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> From<(A, B, C, D, E, F, G, H, I, J, K, L)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> From<(A, B, C, D, E, F, G, H, I, J, K, L, M)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)> for Props

Source§

fn from(_: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)> for Props

Source§

fn from( _: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T), ) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)> for Props

Source§

fn from( _: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U), ) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)> for Props

Source§

fn from( _: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V), ) -> Props

Converts to this type from the input type.
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X)> for Props

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X, Y> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X, Y)> for Props

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X, Y, Z> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X, Y, Z)> for Props

Source§

impl<T> From<T> for Props
where T: 'static + PropsData,

Source§

fn from(data: T) -> Props

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Props

§

impl !RefUnwindSafe for Props

§

impl Send for Props

§

impl Sync for Props

§

impl Unpin for Props

§

impl !UnwindSafe for Props

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> Finalize for T

Source§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Initialize for T
where T: Default,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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.