pub enum WritableAttributeValue<'a> {
DecimalInteger(u64),
SignedDecimalFloatingPoint(f64),
DecimalResolution(DecimalResolution),
QuotedString(Cow<'a, str>),
UnquotedString(Cow<'a, str>),
}Expand description
Provides a writable version of AttributeValue.
This is provided so that custom tag implementations may provide an output that does not depend on having parsed data to derive the write output from. This helps with mutability as well as allowing for custom tags to be constructed from scratch (without being parsed from source data).
While AttributeValue is mostly just a wrapper around a borrowed slice of bytes,
WritableAttributeValue is an enumeration of more value types, as this helps keep converting
from a custom tag more easy (otherwise all users of the library would need to manage
re-constructing the playlist line directly).
Variants§
DecimalInteger(u64)
SignedDecimalFloatingPoint(f64)
A signed float.
From Section 4.2, this represents:
- decimal-floating-point
- signed-decimal-floating-point
DecimalResolution(DecimalResolution)
QuotedString(Cow<'a, str>)
UnquotedString(Cow<'a, str>)
An unquoted string.
From Section 4.2, this represents:
- hexadecimal-sequence
- enumerated-string
Note, this case can be used as an “escape hatch” to write any of the other cases that resolve from unquoted, but those are provided as convenience.
Also note, the library does not validate for correctness of the input value, so take care to not introduce new lines or invalid characters (e.g. whitespace) as this will lead to an invalid HLS playlist.
Trait Implementations§
Source§impl<'a> Clone for WritableAttributeValue<'a>
impl<'a> Clone for WritableAttributeValue<'a>
Source§fn clone(&self) -> WritableAttributeValue<'a>
fn clone(&self) -> WritableAttributeValue<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more