pub struct Handle<T>(/* private fields */)
where
T: Any;
Implementations§
Source§impl<T> Handle<T>where
T: Any,
impl<T> Handle<T>where
T: Any,
pub fn borrow(&self) -> Ref<'_, T>
pub fn borrow_mut(&self) -> RefMut<'_, T>
Sourcepub fn try_unwrap(self) -> Result<T, Handle<T>>
pub fn try_unwrap(self) -> Result<T, Handle<T>>
Tries to take ownership of the underlying T value. Returns Ok(T) on success, Returns Err(Self) on failure A failure may happen if there are still other references to the data
pub fn unwrap(self) -> Result<T, Error>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Handle<T>
impl<T> !RefUnwindSafe for Handle<T>
impl<T> !Send for Handle<T>
impl<T> !Sync for Handle<T>
impl<T> Unpin for Handle<T>where
T: Unpin,
impl<T> !UnwindSafe for Handle<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
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.