Skip to main content

Layer

Struct Layer 

Source
pub struct Layer { /* private fields */ }
Expand description

A layer object.

Implementations§

Source§

impl Layer

Source

pub fn id(&self) -> Token

Returns the ID of self.

Source

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

Finds the first attribute with id.

Source

pub fn payloads(&self) -> Box<dyn Iterator<Item = &Payload>>

Returns an Iterator for the payloads of self.

Source

pub fn add_layer(&mut self, ctx: &mut Context, id: Token) -> &mut Layer

Allocates a new Layer and add it as a child.

Source

pub fn add_attr(&mut self, ctx: &mut Context, id: Token) -> &mut Attr

Allocates a new Attr and add it as a child.

Source

pub fn add_attr_alias(&mut self, ctx: &mut Context, alias: Token, target: Token)

Allocates a new alias Attr.

Source

pub fn add_payload(&mut self, ctx: &mut Context) -> &mut Payload

Allocates a new Payload and add it as a child.

Source

pub fn add_error(&mut self, ctx: &mut Context, id: Token, msg: &str)

Allocates a new error Attr.

Source

pub fn add_tag(&mut self, ctx: &mut Context, id: Token)

Adds id as a tag of self.

Source

pub fn parent(&self) -> Option<&Layer>

Returns a reference to the parent of self.

Source

pub fn parent_mut(&mut self) -> Option<&mut Layer>

Returns a mutable reference to the parent of self.

Source

pub fn range(&self) -> Range

Returns the range of self.

Source

pub fn set_range(&mut self, range: &Range)

Sets the range of self.

Source

pub fn worker(&self) -> u8

Returns the worker ID of self.

Source

pub fn set_worker(&mut self, worker: u8)

Sets the worker ID of self.

Trait Implementations§

Source§

impl Debug for Layer

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Send for Layer

§

impl !Sync for Layer

§

impl Freeze for Layer

§

impl RefUnwindSafe for Layer

§

impl Unpin for Layer

§

impl UnsafeUnpin 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.