Skip to main content

DialectLayers

Struct DialectLayers 

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

A report’s primary format layer and any nested or carried format layers.

Extra layers are unique by (format, instance). An extra layer for the primary format has an instance that identifies it inside the containing document. The wire names the primary explicitly, so the collection carries its complete identity without an enclosing report’s format.

A read rejects a wire whose extra repeats a (format, instance) key, and one whose extra carries the primary key. The key set on the wire is the key set of the value, so no layer is silently discarded or overwritten.

Implementations§

Source§

impl DialectLayers

Source

pub fn of(primary: DialectMatch) -> Self

Constructs dialect layers with one primary and no extra layers.

Source

pub fn insert(&mut self, layer: DialectMatch) -> Result<(), DialectLayerError>

Inserts a layer keyed by (format, instance).

The first layer for a key remains authoritative. A duplicate is returned unchanged so its producer can report the collision.

Source

pub fn with(self, layer: DialectMatch) -> Result<Self, DialectLayerError>

Adds a layer, returning it unchanged when its key is occupied.

Source

pub fn primary(&self) -> &DialectMatch

Returns the report’s primary format layer.

Source

pub fn iter(&self) -> impl Iterator<Item = &DialectMatch>

Iterates over the primary layer followed by every extra layer.

Trait Implementations§

Source§

impl Clone for DialectLayers

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DialectLayers

Source§

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

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

impl<'de> Deserialize<'de> for DialectLayers

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for DialectLayers

Source§

impl FormatIdentityPayload for DialectLayers

Source§

fn format(&self) -> &str

Returns the payload’s authoritative format namespace.
Source§

impl PartialEq for DialectLayers

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DialectLayers

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DialectLayers

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.