Trait NgxRbTreeEntry

Source
pub unsafe trait NgxRbTreeEntry {
    // Required methods
    fn from_rbtree_node(node: NonNull<ngx_rbtree_node_t>) -> NonNull<Self>;
    fn to_rbtree_node(&mut self) -> &mut ngx_rbtree_node_t;
}
Expand description

Trait for pointer conversions between the tree entry and its container.

§Safety

This trait must only be implemented on types that contain a tree node or wrappers with compatible layout. The type then can be used to access elements of a raw rbtree type NgxRbTree linked via specified field.

If the struct can belong to several trees through multiple embedded ngx_rbtree_node_t fields, a separate NgxRbTreeEntry implementation via wrapper type should be used for each tree.

Required Methods§

Source

fn from_rbtree_node(node: NonNull<ngx_rbtree_node_t>) -> NonNull<Self>

Gets a container pointer from tree node.

Source

fn to_rbtree_node(&mut self) -> &mut ngx_rbtree_node_t

Gets an rbtree node from a container reference.

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§