Trait StructureChain

Source
pub unsafe trait StructureChain<H>:
    AsRef<H>
    + AsMut<H>
    + Sized{
    // Required methods
    fn get_mut<T: ExtendingStructure<H>>(&mut self) -> &mut T;
    fn get<T: ExtendingStructure<H>>(&self) -> &T;
    fn unlink<T: ExtendingStructure<H>>(&mut self);
    fn link<T: ExtendingStructure<H>>(&mut self);
}
Expand description

Structure chain trait

Required Methods§

Source

fn get_mut<T: ExtendingStructure<H>>(&mut self) -> &mut T

Return a mutable reference to the given structure Will panic if this structure is not part of the structure chain

Source

fn get<T: ExtendingStructure<H>>(&self) -> &T

Return a reference to the given structure Will panic if this structure is not part of the structure chain

Unlink the given structure from the chain Will panic if this structure is not part of the structure chain

Link the given structure from the chain Do not call this on a structure that has not been unlinked previously Calling link on an already linked structure is safe but has the side effect of unlinking all the other structures linked before the two link calls (which you probably do not want) Will panic if this structure is not part of the structure chain

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.

Implementors§