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

pub struct SegmentHeaderPart<T: Read + Write + Seek> { /* fields omitted */ }
Expand description

A view over the header portion of a segment

Will cache the state of the header internally and flush the changes either when the flush method is called, or on drop.

It is strongly recommended to call the flush method before dropping this type. The Drop impl will attempt to call flush, but will ignore any errors that occur.

Implementations

Attempts to open the header part of a Segment.

Errors:

Will error if decryption fails, the header file has a malformed chunk, or if some other IO error occurs.

Flushes the in-memory buffer to disk.

Will not do anything if no changes have been added.

Will additionally reset the changed flag.

Errors:

Will error if an I/O error occurs during writing.

Will return the chunk header information at the given index, if one exists

Will insert the chunk header information and provide its index

Trait Implementations

Executes the destructor for this type. Read more

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