Struct depot::section::Section

source ·
pub struct Section { /* private fields */ }

Implementations§

A section is used to store items on disk and retrieve them.

Since a section can be become full, it is recommended to use the higher level interfaces that manage the creation of new sections for you, notably a Queue.

Determines if a theoretical offset is past the end of this section.

Opens the section, creating it if it doesn’t exist.

Append the given data to the file.

Determines if the section is empty, i.e. no items have been written to it.

Determines if the section is full, i.e. it will not accept any more items.

Determines the last id that was written, or None if empty.

Forces all items that have been appended to be written out to disk.

Iterate over items stored in this section, starting at the specified id (inclusive, if provided).

Note that this skips over items that were only partially written due to crash or power loss, which is typically the preferred behavior.

Iterate over items stored in this section, starting at the specified id (inclusive, if provided).

Note that this DOES NOT skip over items that may have been partially written. This is not a usual mode of operation, but may be useful for some systems.

Trait Implementations§

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.