Struct Layer

Source
#[repr(C)]
pub struct Layer { /* private fields */ }
Expand description

A layer object.

Implementations§

Source§

impl Layer

Source

pub fn new<C, B>(class: C, data: B) -> Layer

Creates a new Layer.

Source

pub fn id(&self) -> Token

Returns the ID of self.

Source

pub fn data(&self) -> ByteSlice

Returns the type of self.

Source

pub fn headers(&self) -> &[Fixed<Attr>]

Returns the slice of headers.

Source

pub fn attrs(&self) -> &[Fixed<Attr>]

Returns the slice of attributes.

Source

pub fn attr<T>(&self, id: T) -> Option<&Attr>
where T: Into<Token>,

Find the attribute in the Layer.

Source

pub fn add_attr<T>(&mut self, attr: T)
where T: Into<Fixed<Attr>>,

Adds an attribute to the Layer.

Source

pub fn payloads(&self) -> &[Payload]

Returns the slice of payloads.

Source

pub fn add_payload(&mut self, payload: Payload)

Adds a payload to the Layer.

Trait Implementations§

Source§

impl Debug for Layer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Into<MutFixed<Layer>> for Layer

Source§

fn into(self) -> MutFixed<Layer>

Converts this type into the (usually inferred) input type.
Source§

impl Send for Layer

Auto Trait Implementations§

§

impl Freeze for Layer

§

impl !RefUnwindSafe for Layer

§

impl !Sync for Layer

§

impl Unpin for Layer

§

impl !UnwindSafe for Layer

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Erased for T