LostSegmentsList

Struct LostSegmentsList 

Source
pub struct LostSegmentsList { /* private fields */ }
Available on crate feature alloc only.
Expand description

Implementation based on a alloc::vec::Vec which can grow dynamically.

Optionally, a maximum capacity can be specified at creation time. This container allocates at run-time!

Implementations§

Source§

impl LostSegmentsList

Source

pub fn new(opt_capacity: Option<usize>) -> Self

Trait Implementations§

Source§

impl Debug for LostSegmentsList

Source§

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

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

impl Default for LostSegmentsList

Source§

fn default() -> LostSegmentsList

Returns the “default value” for a type. Read more
Source§

impl LostSegmentStore for LostSegmentsList

Source§

type Iter<'a> = Cloned<Iter<'a, (u64, u64)>> where Self: 'a

Source§

fn iter(&self) -> Self::Iter<'_>

Iterate over all lost segments stored.
Source§

fn number_of_segments(&self) -> usize

Current number of lost segments stored.
Source§

fn supports_large_file_size(&self) -> bool

Implementations may explicitely omit support for large file segments to save memory if large file sizes are not used.
Source§

fn capacity(&self) -> Option<usize>

Source§

fn reset(&mut self)

Source§

fn segment_in_store(&self, segment: (u64, u64)) -> bool

Checks whether a segment is already in the store. Read more
Source§

fn add_lost_segment( &mut self, lost_seg: (u64, u64), ) -> Result<(), LostSegmentError>

Add a new lost segment. Read more
Source§

fn coalesce_lost_segments(&mut self) -> Result<(), LostSegmentError>

The lost segment store may additionally have the capability to coalesce overlapping or adjacent segments.
Source§

fn remove_lost_segment( &mut self, segment_to_remove: (u64, u64), ) -> Result<bool, LostSegmentError>

Remove a lost segment. Read more
Source§

fn is_empty(&self) -> bool

Source§

fn write_segments_to_bytes( &self, buf: &mut [u8], file_flag: LargeFileFlag, ) -> Result<usize, LostSegmentWriteError>

Write the segments to the raw byte format of the NAK PDU segment requests as specified by the CFDP standard 5.2.6.1 (NAK PDU).
Source§

fn write_to_nak_segment_list( &self, nak_builder: &mut NakPduCreatorWithReservedSeqReqsBuf<'_>, first_segment_request_for_metadata: bool, ) -> Result<usize, LostSegmentWriteError>

Write the segments to the raw byte buffer of the supplied NAK builder. Read more

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> 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, 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.