Trait flexiber::TagLike

source ·
pub trait TagLike: Copy + PartialEq + Sized {
    // Required method
    fn embedding(self) -> Tag;

    // Provided methods
    fn assert_eq(self, expected: Self) -> Result<Self> { ... }
    fn with_value<V>(self, value: V) -> TaggedValue<V, Self> { ... }
}
Expand description

This is the common trait that types to be used as tags are supposed to implement.

Required Methods§

source

fn embedding(self) -> Tag

To stick with one Error type, make sure the tag type can somehow or other be coerced into a BerTag.

Provided Methods§

source

fn assert_eq(self, expected: Self) -> Result<Self>

Assert that this Tag matches the provided expected tag.

On mismatch, returns an Error with ErrorKind::UnexpectedTag.

source

fn with_value<V>(self, value: V) -> TaggedValue<V, Self>

Ergonomic way to get a TaggedValue for a given tag and value

Object Safety§

This trait is not object safe.

Implementors§