pub enum Metadata {
PreferredAudioContexts(Vec<ContextType>),
StreamingAudioContexts(Vec<ContextType>),
ProgramInfo(String),
Language(String),
CCIDList(Vec<u8>),
ParentalRating(Rating),
ProgramInfoURI(String),
ExtendedMetadata {
type_: u16,
data: Vec<u8>,
},
VendorSpecific {
company_id: CompanyId,
data: Vec<u8>,
},
AudioActiveState(bool),
BroadcastAudioImmediateRenderingFlag,
}
Variants§
PreferredAudioContexts(Vec<ContextType>)
StreamingAudioContexts(Vec<ContextType>)
ProgramInfo(String)
Language(String)
3 byte, lower case language code as defined in ISO 639-3
CCIDList(Vec<u8>)
ParentalRating(Rating)
ProgramInfoURI(String)
ExtendedMetadata
VendorSpecific
AudioActiveState(bool)
BroadcastAudioImmediateRenderingFlag
Trait Implementations§
Source§impl LtValue for Metadata
impl LtValue for Metadata
const NAME: &'static str = "Metadata"
type Type = MetadataType
Source§fn type_from_octet(x: u8) -> Option<Self::Type>
fn type_from_octet(x: u8) -> Option<Self::Type>
Given a type octet, return the associated Type if it is possible.
Returns None if the value is unrecognized.
Source§fn length_range_from_type(ty: Self::Type) -> RangeInclusive<u8>
fn length_range_from_type(ty: Self::Type) -> RangeInclusive<u8>
Returns length bounds for the type indicated, including the type
byte. Note that the assigned numbers from the Bluetooth SIG include
the type byte in their Length specifications.
Source§fn value_encoded_len(&self) -> u8
fn value_encoded_len(&self) -> u8
The length of the encoded value, without the length and type byte.
This cannot be 255 in practice, as the length byte is only one octet
long.
Source§fn decode_value(ty: &Self::Type, buf: &[u8]) -> Result<Self, Error>
fn decode_value(ty: &Self::Type, buf: &[u8]) -> Result<Self, Error>
Decodes the value from a buffer, which does not include the type or
length bytes. The
buf
slice length is exactly what was specified
for this value in the encoded source.Source§fn encode_value(&self, buf: &mut [u8]) -> Result<(), Error>
fn encode_value(&self, buf: &mut [u8]) -> Result<(), Error>
Encodes a value into
buf
, which is verified to be the correct length
as indicated by LtValue::value_encoded_len.Source§fn decode_all(buf: &[u8]) -> (Vec<Result<Self, Error<Self::Type>>>, usize)
fn decode_all(buf: &[u8]) -> (Vec<Result<Self, Error<Self::Type>>>, usize)
Decode a collection of LtValue structures that are present in a buffer.
If it is possible to continue decoding after encountering an error, does
so and includes the error. If an unrecoverable error occurs, does
not consume the final item and the last element in the result is the
error.
impl Eq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Decodable for Twhere
T: LtValue,
impl<T> Decodable for Twhere
T: LtValue,
type Error = Error<<T as LtValue>::Type>
Source§fn decode(buf: &[u8]) -> (Result<T, <T as Decodable>::Error>, usize)
fn decode(buf: &[u8]) -> (Result<T, <T as Decodable>::Error>, usize)
Decodes into a new object or an error, and the number of bytes that
the decoding consumed. Should attempt to consume the entire item from
the buffer in the case of an error. If the item end cannot be determined,
return an error and consume the entirety of the bufer (
buf.len()
)Source§fn decode_multiple(
buf: &[u8],
max: Option<usize>,
) -> (Vec<Result<Self, Self::Error>>, usize)
fn decode_multiple( buf: &[u8], max: Option<usize>, ) -> (Vec<Result<Self, Self::Error>>, usize)
Tries to decode a collection of this object concatenated in a buffer.
Returns a vector of items (or errors) and the number of bytes consumed to
decode them.
Continues to decode items until the buffer is consumed or the max items.
If None, will decode the entire buffer.