[][src]Struct asuran::repository::backend::multifile::segment::SegmentHandler

pub struct SegmentHandler {
    input: Sender<SegmentHandlerCommand>,
    path: String,


input: Sender<SegmentHandlerCommand>path: String


impl SegmentHandler[src]


  1. In order to ensure file locks are freed and all data is written to disk, you must ensure that you call the close function on all segments before the program terminates.

pub fn open(
    repository_path: impl AsRef<Path>,
    size_limit: u64,
    segments_per_directory: u64,
    chunk_settings: ChunkSettings,
    key: Key
) -> Result<SegmentHandler>

Opens a SegmentHandler, creating the data directory and the initial segment if it does not exist


Will error if creating/locking a segment fails, such as if the user does not have access to that directory, or if any other I/O error occurs

pub async fn read_chunk<'_>(
    &'_ mut self,
    location: SegmentDescriptor
) -> Result<Chunk>

pub async fn write_chunk<'_>(
    &'_ mut self,
    chunk: Chunk
) -> Result<SegmentDescriptor>

pub async fn close<'_>(&'_ mut self)[src]

Trait Implementations

impl Clone for SegmentHandler[src]

impl Debug for SegmentHandler[src]

Auto Trait Implementations

impl !RefUnwindSafe for SegmentHandler

impl Send for SegmentHandler

impl Sync for SegmentHandler

impl Unpin for SegmentHandler

impl !UnwindSafe for SegmentHandler

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]