#[repr(C)]pub struct AnyView<'a> { /* private fields */ }
Expand description
Unmanaged Any that can hold reference to values
Implementations§
Source§impl<'a> AnyView<'a>
impl<'a> AnyView<'a>
pub fn new() -> Self
pub fn type_index(&self) -> i32
Sourcepub fn try_as<T>(&self) -> Option<T>where
T: AnyCompatible,
pub fn try_as<T>(&self) -> Option<T>where
T: AnyCompatible,
More strict version than try_from/try_into
This function will not try to cast the type and ensures invariance that the return value is only Some(T) Any::from(T) contains exactly the same value value
will return Some(T) if the type is exactly compatible with T will return None if the type is not compatible with T
Sourcepub fn debug_strong_count(&self) -> Option<usize>
pub fn debug_strong_count(&self) -> Option<usize>
Get the strong count of the underlying object for testing/debugging purposes
If the underlying object is not ref counted, return None
Trait Implementations§
Source§impl<'a> TryFrom<AnyView<'a>> for DLDataType
impl<'a> TryFrom<AnyView<'a>> for DLDataType
Source§impl<'a, T: AnyCompatible> TryFrom<AnyView<'a>> for TryFromTemp<T>
impl<'a, T: AnyCompatible> TryFrom<AnyView<'a>> for TryFromTemp<T>
impl<'a> Copy for AnyView<'a>
Auto Trait Implementations§
impl<'a> Freeze for AnyView<'a>
impl<'a> RefUnwindSafe for AnyView<'a>
impl<'a> !Send for AnyView<'a>
impl<'a> !Sync for AnyView<'a>
impl<'a> Unpin for AnyView<'a>
impl<'a> UnwindSafe for AnyView<'a>
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