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
pub fn new() -> Self
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.
pub fn get(&self, k: &str) -> Option<&str>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodecOptions
impl Debug for CodecOptions
Source§impl Default for CodecOptions
impl Default for CodecOptions
Source§fn default() -> CodecOptions
fn default() -> CodecOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodecOptions
impl RefUnwindSafe for CodecOptions
impl Send for CodecOptions
impl Sync for CodecOptions
impl Unpin for CodecOptions
impl UnsafeUnpin for CodecOptions
impl UnwindSafe for CodecOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more