IntoElement

Trait IntoElement 

Source
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§

Source

const SINGLE_BYTE: bool = false

If the element name can be encoded in a single byte

Required Methods§

Source

fn encode(&self, v: &mut Batch)

Encode the element into the message channel

Provided Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl<'a, 'b> IntoElement<'a, 'b> for &'a str

Source§

fn encode(&self, v: &mut Batch)

Implementors§

Source§

impl<'a, 'b> IntoElement<'a, 'b> for Element

Source§

impl<'a, 'b> IntoElement<'a, 'b> for InNamespace<'a, &'b str>

Source§

impl<'a, 'b> IntoElement<'a, 'b> for InNamespace<'a, Element>