Struct asuran::repository::backend::common::segment::SegmentDataPart[][src]

pub struct SegmentDataPart<T> { /* fields omitted */ }
Expand description

A view over the data portion of a segment.

Implementations

Will attempt to open the given handle as a SegmentDataPart

Errors

  • Will propagate any IO errors
  • Will return Err(BackendError::SegmentError) if the segment has a header and it fails validation

If the segment has non-zero length, will do nothing and return Ok(false).

Otherwise, will write the header to the segment file.

Errors

Will return Err if any underlying I/O errors occur

Will attempt to read the header from the segment

Errors

  • Will return Err(BackendError::Unknown) if deserializing the header fails
  • Will propagate any I/O errors that occur

Returns the current size of the segment file

Errors

Will propagate any I/O errors that occur

Returns the number of free bytes remaining in this segment

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more