pub struct MP3CodecTypeBuilder { /* private fields */ }Expand description
A builder for the bitfield.
Implementations§
Source§impl MP3CodecTypeBuilder
impl MP3CodecTypeBuilder
Sourcepub fn new_without_defaults() -> Self
pub fn new_without_defaults() -> Self
Creates a new bitfield builder instance without setting any default values.
Sourcepub fn with_protect_bit(self, bits: bool) -> Self
pub fn with_protect_bit(self, bits: bool) -> Self
Sets builder bits [0..=1].
Sourcepub fn checked_with_protect_bit(self, bits: bool) -> Result<Self, &'static str>
pub fn checked_with_protect_bit(self, bits: bool) -> Result<Self, &'static str>
Sets builder bits [0..=1]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn with_layer(self, bits: u8) -> Self
pub fn with_layer(self, bits: u8) -> Self
Sets builder bits [1..=3].
Sourcepub fn checked_with_layer(self, bits: u8) -> Result<Self, &'static str>
pub fn checked_with_layer(self, bits: u8) -> Result<Self, &'static str>
Sets builder bits [1..=3]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn checked_with_id(self, bits: u8) -> Result<Self, &'static str>
pub fn checked_with_id(self, bits: u8) -> Result<Self, &'static str>
Sets builder bits [3..=5]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn with_sync_word(self, bits: u16) -> Self
pub fn with_sync_word(self, bits: u16) -> Self
Sets builder bits [5..=16].
Sourcepub fn checked_with_sync_word(self, bits: u16) -> Result<Self, &'static str>
pub fn checked_with_sync_word(self, bits: u16) -> Result<Self, &'static str>
Sets builder bits [5..=16]. Returns an error if the value is too big to fit within the field bits.
Sourcepub fn build(self) -> MP3CodecType
pub fn build(self) -> MP3CodecType
Builds a bitfield instance from the builder.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MP3CodecTypeBuilder
impl RefUnwindSafe for MP3CodecTypeBuilder
impl Send for MP3CodecTypeBuilder
impl Sync for MP3CodecTypeBuilder
impl Unpin for MP3CodecTypeBuilder
impl UnwindSafe for MP3CodecTypeBuilder
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