pub struct CodecOptions { /* private fields */ }Expand description
Untyped string → string bag. The over-the-wire shape of options as they travel from the caller (CLI / pipeline JSON / FFI) to a codec factory.
Insertion order is preserved and iter walks keys in
the order they were set. Duplicate keys overwrite (last writer
wins).
Implementations§
Source§impl CodecOptions
impl CodecOptions
Sourcepub fn set(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn set(self, k: impl Into<String>, v: impl Into<String>) -> Self
Builder-style setter, useful for one-liners.
CodecOptions::new().set("interlace", "true").
Sourcepub fn insert(&mut self, k: impl Into<String>, v: impl Into<String>)
pub fn insert(&mut self, k: impl Into<String>, v: impl Into<String>)
Mutating insert. Overwrites any existing entry with the same key.
Sourcepub fn get(&self, k: &str) -> Option<&str>
pub fn get(&self, k: &str) -> Option<&str>
Look up the value for key k, or None if the key was never
set.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
Iterate over (key, value) pairs in insertion order.
Sourcepub fn from_json(s: &str) -> Result<Self>
pub fn from_json(s: &str) -> Result<Self>
Build a bag from a JSON object. Scalar values (bool / number / string) are stringified into the bag; arrays and nested objects are rejected — keys with structured values don’t map into the flat string bag.
Sourcepub fn from_json_value(v: &Value) -> Result<Self>
pub fn from_json_value(v: &Value) -> Result<Self>
As from_json but takes a pre-parsed value
(the shape pipelines already use — TrackSpec.codec_params).
Trait Implementations§
Source§impl Clone for CodecOptions
impl Clone for CodecOptions
Source§fn clone(&self) -> CodecOptions
fn clone(&self) -> CodecOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more