Skip to main content

Context

Trait Context 

Source
pub trait Context<T: Token>: Fixed<T> {
    // Required method
    unsafe fn bytes<'a>(&'a self, buffer: &'a T) -> &'a [u8] ⓘ;
}
Expand description

Projects a completed prefix from its original fixed-residency payload allocation.

Required Methods§

Source

unsafe fn bytes<'a>(&'a self, buffer: &'a T) -> &'a [u8] ⓘ

§Safety

The completed token belongs to this exact context and retains its selected slot. Its initialized prefix remains immutable and unavailable to the producer until the borrow ends.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§