Trait ReferenceBoxPointer

Source
pub trait ReferenceBoxPointer<T> {
    // Required methods
    fn with<Block, Return>(&self, block: Block) -> Return
       where Block: FnOnce(&T) -> Return;
    fn with_not_null<Block>(&self, block: Block)
       where Block: FnOnce(&T);
    fn with_not_null_return<Block, Return>(
        &self,
        default: Return,
        block: Block,
    ) -> Return
       where Block: FnOnce(&T) -> Return;
    fn with_not_null_return_block<DefaultBlock, Block, Return>(
        &self,
        default: DefaultBlock,
        block: Block,
    ) -> Return
       where DefaultBlock: FnOnce() -> Return,
             Block: FnOnce(&T) -> Return;
    fn drop(self);
}

Required Methods§

Source

fn with<Block, Return>(&self, block: Block) -> Return
where Block: FnOnce(&T) -> Return,

Source

fn with_not_null<Block>(&self, block: Block)
where Block: FnOnce(&T),

Source

fn with_not_null_return<Block, Return>( &self, default: Return, block: Block, ) -> Return
where Block: FnOnce(&T) -> Return,

Source

fn with_not_null_return_block<DefaultBlock, Block, Return>( &self, default: DefaultBlock, block: Block, ) -> Return
where DefaultBlock: FnOnce() -> Return, Block: FnOnce(&T) -> Return,

Source

fn drop(self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ReferenceBoxPointer<T> for *mut ReferenceBox<T>

Source§

fn with<Block, Return>(&self, block: Block) -> Return
where Block: FnOnce(&T) -> Return,

Source§

fn with_not_null<Block>(&self, block: Block)
where Block: FnOnce(&T),

Source§

fn with_not_null_return<Block, Return>( &self, default: Return, block: Block, ) -> Return
where Block: FnOnce(&T) -> Return,

Source§

fn with_not_null_return_block<DefaultBlock, Block, Return>( &self, default: DefaultBlock, block: Block, ) -> Return
where DefaultBlock: FnOnce() -> Return, Block: FnOnce(&T) -> Return,

Source§

fn drop(self)

Implementors§