pub struct OptionCollection(/* private fields */);
Expand description
A collection of options in a TFTP message.
Implementations§
Source§impl OptionCollection
impl OptionCollection
Sourcepub fn iter(&self) -> impl Iterator<Item = &Forceable<TftpOption>>
pub fn iter(&self) -> impl Iterator<Item = &Forceable<TftpOption>>
Returns an iterator over the contained options.
Sourcepub fn try_push(
&mut self,
option: Forceable<TftpOption>,
) -> Result<(), Forceable<TftpOption>>
pub fn try_push( &mut self, option: Forceable<TftpOption>, ) -> Result<(), Forceable<TftpOption>>
Pushes a new option.
Returns an error if if this OptionCollection
already contains
MAX_OPTIONS
.
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Gets the total serialized length of the contained options.
Sourcepub fn collect(&self) -> AllOptions
pub fn collect(&self) -> AllOptions
Collects the containing options into AllOptions
.
Trait Implementations§
Source§impl Debug for OptionCollection
impl Debug for OptionCollection
Source§impl Default for OptionCollection
impl Default for OptionCollection
Source§fn default() -> OptionCollection
fn default() -> OptionCollection
Returns the “default value” for a type. Read more
Source§impl FromIterator<Forceable<TftpOption>> for OptionCollection
impl FromIterator<Forceable<TftpOption>> for OptionCollection
Source§fn from_iter<T: IntoIterator<Item = Forceable<TftpOption>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Forceable<TftpOption>>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for OptionCollection
impl RefUnwindSafe for OptionCollection
impl Send for OptionCollection
impl Sync for OptionCollection
impl Unpin for OptionCollection
impl UnwindSafe for OptionCollection
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