Struct nuts_directory::DirectoryBackend

source ·
pub struct DirectoryBackend<P: AsRef<Path>> { /* private fields */ }

Trait Implementations§

source§

impl<P: AsRef<Path>> Backend for DirectoryBackend<P>

§

type Settings = Settings

Runtime configuration used by the backend. Read more
§

type Err = Error

The error type used by methods of this trait.
§

type Id = Id

The id identifies a block in the storage. It is used everywhere you need a pointer to a block.
§

type Info = Info

Information of the backend. Read more
source§

fn info(&self) -> Result<Info, Error>

Returns information from the backend. Read more
source§

fn block_size(&self) -> u32

Returns the block size of the backend.
source§

fn aquire(&mut self, buf: &[u8]) -> Result<Self::Id, Error>

Aquires a new block in the backend. Read more
source§

fn release(&mut self, id: Self::Id) -> Result<(), Error>

Releases a block again. Read more
source§

fn read(&mut self, id: &Id, buf: &mut [u8]) -> Result<usize, Error>

Reads a block from the backend. Read more
source§

fn write(&mut self, id: &Id, buf: &[u8]) -> Result<usize, Error>

Writes a block into the backend. Read more
source§

fn write_header(&mut self, buf: &[u8; 512]) -> Result<(), Error>

Puts the given buf into the header of the backend. Read more
source§

fn delete(self)

Deletes the entire instance and all traces. Read more
source§

impl<P: AsRef<Path>> Create<DirectoryBackend<P>> for CreateOptions<P>

source§

fn settings(&self) -> Settings

Returns the settings of this backend instance. Read more
source§

fn build( self, header: [u8; 512], overwrite: bool ) -> Result<DirectoryBackend<P>, Error>

Create an instance of the Backend. Read more
source§

impl<P: Debug + AsRef<Path>> Debug for DirectoryBackend<P>

source§

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

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

impl<P: AsRef<Path>> Open<DirectoryBackend<P>> for OpenOptions<P>

source§

fn build(self, settings: Settings) -> Result<DirectoryBackend<P>, Error>

Create an instance of the Backend. Read more
source§

impl<P: AsRef<Path>> ReceiveHeader<DirectoryBackend<P>> for DirectoryBackend<P>

source§

fn get_header_bytes(&mut self, bytes: &mut [u8; 512]) -> Result<(), Error>

Receives the binary header data from the backend. Read more
source§

impl<P: AsRef<Path>> ReceiveHeader<DirectoryBackend<P>> for OpenOptions<P>

source§

fn get_header_bytes(&mut self, bytes: &mut [u8; 512]) -> Result<(), Error>

Receives the binary header data from the backend. Read more

Auto Trait Implementations§

§

impl<P> Freeze for DirectoryBackend<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for DirectoryBackend<P>
where P: RefUnwindSafe,

§

impl<P> Send for DirectoryBackend<P>
where P: Send,

§

impl<P> Sync for DirectoryBackend<P>
where P: Sync,

§

impl<P> Unpin for DirectoryBackend<P>
where P: Unpin,

§

impl<P> UnwindSafe for DirectoryBackend<P>
where P: UnwindSafe,

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

§

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

§

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.