pub trait ValueBoxPointer<T: Any> {
Show 21 methods fn to_ref(&self) -> Result<BoxRef<T>>; fn take_value(&self) -> Result<T>; fn release(self); fn with_ref<R: Any, F>(&self, op: F) -> Result<R>
    where
        F: FnOnce(&T) -> Result<R>
, { ... } fn with_ref_ok<R: Any, F>(&self, op: F) -> Result<R>
    where
        F: FnOnce(&T) -> R
, { ... } fn with_mut<R: Any, F>(&self, op: F) -> Result<R>
    where
        F: FnOnce(&mut T) -> Result<R>
, { ... } fn with_mut_ok<R: Any, F>(&self, op: F) -> Result<R>
    where
        F: FnOnce(&mut T) -> R
, { ... } fn with_clone<R: Any, F>(&self, op: F) -> Result<R>
    where
        F: FnOnce(T) -> Result<R>,
        T: Clone
, { ... } fn with_clone_ok<R: Any, F>(&self, op: F) -> Result<R>
    where
        F: FnOnce(T) -> R,
        T: Clone
, { ... } fn with_ref_ref<R: Any, F, P: Any>(
        &self,
        ptr: *mut ValueBox<P>,
        op: F
    ) -> Result<R>
    where
        F: FnOnce(&T, &P) -> Result<R>
, { ... } fn with_ref_ref_ref<R: Any, F, P1: Any, P2: Any>(
        &self,
        ptr1: *mut ValueBox<P1>,
        ptr2: *mut ValueBox<P2>,
        op: F
    ) -> Result<R>
    where
        F: FnOnce(&T, &P1, &P2) -> Result<R>
, { ... } fn with_ref_ref_ref_ref<R: Any, F, P1: Any, P2: Any, P3: Any>(
        &self,
        ptr1: *mut ValueBox<P1>,
        ptr2: *mut ValueBox<P2>,
        ptr3: *mut ValueBox<P3>,
        op: F
    ) -> Result<R>
    where
        F: FnOnce(&T, &P1, &P2, &P3) -> Result<R>
, { ... } fn replace_value<F>(&self, op: F) -> Result<()>
    where
        F: FnOnce(T) -> T
, { ... } fn has_value(&self) -> bool { ... } fn get_ptr(&self) -> *const T { ... } fn is_valid(&self) -> bool { ... } fn with_not_null<Block>(&self, block: Block)
    where
        Block: FnOnce(&mut T)
, { ... } fn with_not_null_return<Block, Return: Any>(
        &self,
        default: Return,
        block: Block
    ) -> Return
    where
        Block: FnOnce(&mut T) -> Return
, { ... } fn with_value<DefaultBlock, Block, Return: Any>(
        &self,
        default: DefaultBlock,
        block: Block
    ) -> Return
    where
        DefaultBlock: FnOnce() -> Return,
        Block: FnOnce(T) -> Return,
        T: Clone
, { ... } fn with_not_null_value<Block>(&self, block: Block)
    where
        Block: FnOnce(T),
        T: Clone
, { ... } fn with_not_null_value_return<Block, Return: Any>(
        &self,
        default: Return,
        block: Block
    ) -> Return
    where
        Block: FnOnce(T) -> Return,
        T: Clone
, { ... }
}

Required Methods§

Get the reference to the underlying box without dropping it.

Take the value out of the box.

Provided Methods§

Evaluate a given function with a reference to the boxed value. The the reference can not outlive the closure.

Evaluate a given function with a reference to the boxed value. The the reference can not outlive the closure.

Evaluate a given function with a mutable reference to the boxed value. The lifetime of the reference can not outlive the closure.

Evaluate a given function that can not fail with a mutable reference to the boxed value. The lifetime of the reference can not outlive the closure.

Evaluate a given function with a clone of the boxed value. The boxed type T must implement Clone.

Evaluate a given function with a clone of the boxed value. The boxed type T must implement Clone.

Evaluate a given function with references to given boxed values. The lifetime of the reference can not outlive the closure.

Evaluate a given function with references to given boxed values. The lifetime of the reference can not outlive the closure.

Evaluate a given function with references to given boxed values. The lifetime of the reference can not outlive the closure.

Evaluate a given function with the value taken out of the box and place the new value back. The value returned by the function must be of the same type as the box

👎Deprecated since 0.1.0: please use has_value instead
👎Deprecated since 0.1.0: please use with_ref or with_mut instead
👎Deprecated since 0.1.0: please use with_ref or with_mut instead
👎Deprecated since 0.1.0: please use with_ref or with_mut instead
👎Deprecated since 0.1.0: please use with_ref or with_mut instead
👎Deprecated since 0.1.0: please use with_ref or with_mut instead

Implementations on Foreign Types§

Implementors§