Enum CodecConfiguration

Source
pub enum CodecConfiguration {
    SamplingFrequency(SamplingFrequency),
    FrameDuration(FrameDuration),
    AudioChannelAllocation(HashSet<AudioLocation>),
    OctetsPerCodecFrame(u16),
    CodecFramesPerSdu(u8),
}
Expand description

Codec Configuration LTV Structures

Defined in Assigned Numbers Section 6.12.5.

Variants§

§

SamplingFrequency(SamplingFrequency)

§

FrameDuration(FrameDuration)

§

AudioChannelAllocation(HashSet<AudioLocation>)

§

OctetsPerCodecFrame(u16)

§

CodecFramesPerSdu(u8)

Trait Implementations§

Source§

impl Clone for CodecConfiguration

Source§

fn clone(&self) -> CodecConfiguration

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CodecConfiguration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl LtValue for CodecConfiguration

Source§

const NAME: &'static str = "Codec Compatability"

Source§

type Type = CodecConfigurationType

Source§

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>

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 into_type(&self) -> Self::Type

Retrieve the type of the current value.
Source§

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 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_value(ty: &CodecConfigurationType, 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 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.
Source§

fn encode_all( iter: impl Iterator<Item = Self>, buf: &mut [u8], ) -> Result<(), Error>

Encode a collection of LtValue structures into a buffer. Even if the encoding fails, buf may still be modified by previous encoding successes.
Source§

impl PartialEq for CodecConfiguration

Source§

fn eq(&self, other: &CodecConfiguration) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for CodecConfiguration

Source§

impl StructuralPartialEq for CodecConfiguration

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Decodable for T
where T: LtValue,

Source§

type Error = Error<<T as LtValue>::Type>

Source§

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)

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.
Source§

impl<T> Encodable for T
where T: LtValue,

Source§

type Error = Error

Source§

fn encoded_len(&self) -> usize

Returns the number of bytes necessary to encode |self|.
Source§

fn encode(&self, buf: &mut [u8]) -> Result<(), <T as Encodable>::Error>

Writes the encoded version of |self| at the start of |buf|. |buf| must be at least |self.encoded_len()| length.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.