#[repr(transparent)]pub struct SendValue { /* private fields */ }
Expand description
A version of Value
for storing Send
types, that implements Send
itself.
See the module documentation for more details.
Implementations
Methods from Deref<Target = Value>
sourcepub fn get<'a, T>(
&'a self
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error> where
T: FromValue<'a>,
pub fn get<'a, T>(
&'a self
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error> where
T: FromValue<'a>,
Tries to get a value of type T
.
Returns Ok
if the type is correct.
sourcepub fn get_owned<T>(
&self
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error> where
T: for<'b> FromValue<'b> + 'static,
pub fn get_owned<T>(
&self
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error> where
T: for<'b> FromValue<'b> + 'static,
Tries to get a value of an owned type T
.
sourcepub fn is<T: StaticType>(&self) -> bool
pub fn is<T: StaticType>(&self) -> bool
Returns true
if the type of the value corresponds to T
or is a sub-type of T
.
sourcepub fn is_type(&self, type_: Type) -> bool
pub fn is_type(&self, type_: Type) -> bool
Returns true
if the type of the value corresponds to type_
or is a sub-type of type_
.
Trait Implementations
impl Send for SendValue
Auto Trait Implementations
impl RefUnwindSafe for SendValue
impl !Sync for SendValue
impl Unpin for SendValue
impl UnwindSafe for SendValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToClosureReturnValue for T where
T: ToValue,
impl<T> ToClosureReturnValue for T where
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
sourceimpl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
sourcefn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a SendValue
clone of self
.