#[non_exhaustive]pub enum PropContainer<T> {
Rc(Rc<T>),
RcRefCell(Rc<RefCell<T>>),
RefContainer(RefContainer<T>),
State(State<T>),
Memo(Memo<T>),
DeferredValue(DeferredValue<T>),
}
Expand description
A helpful abstraction over non-Copy
types that can be used as a prop
type for components.
Can contain all hook containers, Rc<T>
, and Rc<RefCell<T>>
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rc(Rc<T>)
RcRefCell(Rc<RefCell<T>>)
RefContainer(RefContainer<T>)
State(State<T>)
Memo(Memo<T>)
DeferredValue(DeferredValue<T>)
Implementations§
Source§impl<T: 'static> PropContainer<T>
impl<T: 'static> PropContainer<T>
Sourcepub fn value(&self) -> PropContainerRef<'_, T>
pub fn value(&self) -> PropContainerRef<'_, T>
Returns a read-only reference to the underlying value.
Trait Implementations§
Source§impl<T> Clone for PropContainer<T>
impl<T> Clone for PropContainer<T>
Source§impl<T: Debug> Debug for PropContainer<T>
impl<T: Debug> Debug for PropContainer<T>
Source§impl<T> From<DeferredValue<T>> for PropContainer<T>
impl<T> From<DeferredValue<T>> for PropContainer<T>
Source§fn from(value: DeferredValue<T>) -> Self
fn from(value: DeferredValue<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<Memo<T>> for PropContainer<T>
impl<T> From<Memo<T>> for PropContainer<T>
Source§impl<T> From<Rc<T>> for PropContainer<T>
impl<T> From<Rc<T>> for PropContainer<T>
Source§impl<T> From<RefContainer<T>> for PropContainer<T>
impl<T> From<RefContainer<T>> for PropContainer<T>
Source§fn from(value: RefContainer<T>) -> Self
fn from(value: RefContainer<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<State<T>> for PropContainer<T>
impl<T> From<State<T>> for PropContainer<T>
Source§impl<T> From<T> for PropContainer<T>
impl<T> From<T> for PropContainer<T>
Source§impl<T: PartialEq + 'static> PartialEq<T> for PropContainer<T>
impl<T: PartialEq + 'static> PartialEq<T> for PropContainer<T>
Source§impl<T: PartialEq + 'static> PartialEq for PropContainer<T>
impl<T: PartialEq + 'static> PartialEq for PropContainer<T>
Auto Trait Implementations§
impl<T> Freeze for PropContainer<T>
impl<T> !RefUnwindSafe for PropContainer<T>
impl<T> !Send for PropContainer<T>
impl<T> !Sync for PropContainer<T>
impl<T> Unpin for PropContainer<T>
impl<T> !UnwindSafe for PropContainer<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more