pub trait IntoElement<'a, 'b>: Sealed + Into<AnyElement<'a, 'b>> {
const SINGLE_BYTE: bool = false;
// Required method
fn encode(&self, v: &mut Batch);
// Provided method
unsafe fn encode_prealloc(&self, v: &mut Batch)
where Self: Sized { ... }
}Expand description
Anything that can be turned into an element name
Provided Associated Constants§
Sourceconst SINGLE_BYTE: bool = false
const SINGLE_BYTE: bool = false
If the element name can be encoded in a single byte
Required Methods§
Provided Methods§
Sourceunsafe fn encode_prealloc(&self, v: &mut Batch)where
Self: Sized,
unsafe fn encode_prealloc(&self, v: &mut Batch)where
Self: Sized,
Encode the element into the message channel with memory pre-allocated
§Safety
This is only safe if the batch is preallocated to the correct size
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.