pub struct MediaPayloadMetadataCollection { /* private fields */ }
Expand description

Allows storing arbitrary attributes and value pairs that can are relevant to an individual media payload/packet. These are stored in a relatively efficient way to make it cheap to clone and attempt to minimize per-packet heap allocations. Once a metadata collection has been created it cannot be modified.

The metadata currently relies on being passed in a BytesMut buffer that it will use for storage. This allows for the creator of media payloads to maintain an arena style memory buffer that persists across media payloads, which should eventually cause each media payload to no longer require its own heap allocation and efficiently re-use unreserved parts of the memory buffer.

The trade off for cloning and allocation efficiency is that iterating through metadata is an O(N) operation, which means if you need to look for a specific type of metadata you may have to iterate through all other metadata items first. This tradeoff was deemed acceptable for now with the idea that each payload would only have a small amount of metadata attached to it.

Implementations

Creates a new collection of metadata based on the provided entries. A buffer is passed in which can allow the creators of the collection to maintain an arena to reduce allocations for each new metadata collection that is created.

Provides a non-consuming iterator that allows reading of entries within the collection

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more