pub unsafe trait NgxQueueEntry {
// Required methods
fn from_queue(queue: NonNull<ngx_queue_t>) -> NonNull<Self>;
fn to_queue(&mut self) -> &mut ngx_queue_t;
}
Expand description
Trait for pointer conversions between the queue entry and its container.
§Safety
This trait must only be implemented on types that contain a queue link or wrappers with compatible layout. The type then can be used to access elements of a raw queue type NgxQueue linked via specified field.
If the struct can belong to several queues through multiple embedded ngx_queue_t
fields,
a separate NgxQueueEntry implementation via wrapper type should be used for each queue.
Required Methods§
Sourcefn from_queue(queue: NonNull<ngx_queue_t>) -> NonNull<Self>
fn from_queue(queue: NonNull<ngx_queue_t>) -> NonNull<Self>
Gets a container pointer from queue node.
Sourcefn to_queue(&mut self) -> &mut ngx_queue_t
fn to_queue(&mut self) -> &mut ngx_queue_t
Gets a queue 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.