[−][src]Struct dync::ValueMut
A generic mutable value reference into a buffer.
Implementations
impl<'a, V: HasDrop> ValueMut<'a, V>[src]
pub fn new<T: Any>(typed: &'a mut T) -> ValueMut<'a, V> where
V: VTable<T>, [src]
V: VTable<T>,
Create a new ValueRef from a typed reference.
impl<'a, V: ?Sized + HasDrop> ValueMut<'a, V>[src]
pub fn size(&self) -> usize[src]
Get the size of the value pointed-to by this reference.
pub fn value_type_id(&self) -> TypeId[src]
Get the TypeId of the referenced value.
pub fn is<T: 'static>(&self) -> bool[src]
Returns true if this referenced value's type is the same as T.
pub fn swap<'b>(&mut self, other: &mut ValueMut<'b, V>)[src]
Swap the values between other and self.
pub fn assign<B: GetBytesMut>(&mut self, value: Value<B, V>)[src]
Moves the given value into self.
pub fn clone_from_other<'b>(
&mut self,
other: impl Into<ValueRef<'b, V>>
) -> Result<(), Error> where
V: HasClone + 'b, [src]
&mut self,
other: impl Into<ValueRef<'b, V>>
) -> Result<(), Error> where
V: HasClone + 'b,
Clone other into self.
This function will call drop on any values stored in self.
pub fn clone_value(&self) -> Value<Box<[u8]>, V> where
V: HasClone + Clone, [src]
V: HasClone + Clone,
Clone the referenced value.
Unlike the Clone trait, this function will produce an owned clone of the value pointed to
by this value reference.
pub fn clone_small_value(&self) -> Value<usize, V> where
V: HasClone + Clone, [src]
V: HasClone + Clone,
Clone the referenced value.
Unlike the Clone trait, this function will produce an owned clone of the value pointed to
by this value reference.
This version of clone_value tries to fit the underlying value into a usize sized value,
and panics if that fails.
pub fn downcast<T: 'static>(self) -> Option<&'a mut T>[src]
Downcast this value reference into a borrowed T type. Return None if the downcast fails.
pub fn upcast<U: ?Sized + HasDrop + From<V>>(self) -> ValueMut<'a, U> where
V: Clone, [src]
V: Clone,
A consuming upcast that carries the lifetime of the underlying value reference.
pub fn upcast_mut<U: ?Sized + HasDrop + From<V>>(&mut self) -> ValueMut<U> where
V: Clone, [src]
V: Clone,
Create a new mutable value reference upcast from the current one.
pub fn reborrow(&self) -> ValueRef<V>[src]
pub fn reborrow_mut(&mut self) -> ValueMut<V>[src]
Trait Implementations
impl<'a, V: ?Sized + HasDebug + HasDrop> Debug for ValueMut<'a, V>[src]
impl<'a, V: ?Sized + HasEq + HasDrop> Eq for ValueMut<'a, V>[src]
impl<'a, V: Any + Clone> From<CopyValueMut<'a, V>> for ValueMut<'a, (DropFn, V)>[src]
impl<'a, V: HasDrop> From<ValueMut<'a, V>> for Meta<VTableRef<'a, V>>[src]
impl<'a, V: HasDrop> From<ValueMut<'a, V>> for ValueRef<'a, V>[src]
impl<'a, V: ?Sized + HasPartialEq + HasDrop> PartialEq<ValueMut<'a, V>> for ValueMut<'a, V>[src]
Auto Trait Implementations
impl<'a, V: ?Sized> RefUnwindSafe for ValueMut<'a, V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
impl<'a, V: ?Sized> Send for ValueMut<'a, V> where
V: Send + Sync,
V: Send + Sync,
impl<'a, V: ?Sized> Sync for ValueMut<'a, V> where
V: Sync,
V: Sync,
impl<'a, V: ?Sized> Unpin for ValueMut<'a, V>
impl<'a, V> !UnwindSafe for ValueMut<'a, V>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DebugBytes for T where
T: 'static + Debug, [src]
T: 'static + Debug,
impl<T> Downcast for T where
T: Any, [src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>[src]
fn as_any(&self) -> &(dyn Any + 'static)[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any, [src]
T: Send + Sync + Any,
impl<T> DropBytes for T where
T: 'static, [src]
T: 'static,
unsafe fn drop_bytes(&mut [u8])[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>, [src]
T: 'static + PartialEq<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,