Struct Directory

Source
pub struct Directory<T>(/* private fields */);

Implementations§

Source§

impl<T> Directory<T>

Source

pub const INIT_BLOCK_SIZE: usize = 512usize

Source

pub fn entry_kind(&self, name: &str) -> Option<EntryKind>

Get the type of the child object

Source§

impl<T: Clone> Directory<T>

Source§

impl<T: Read + Write + Seek> Directory<T>

Source

pub fn make_root(back: T) -> Result<Directory<T>>

Source

pub fn open_root_for_update(back: T, offset: u64) -> Result<Directory<T>>

Source

pub fn flush(&mut self) -> Result<()>

Source

pub fn create_blob(&mut self, name: &str, size: usize) -> Result<Blob<T>>

Source

pub fn open_or_create_directory(&mut self, name: &str) -> Result<Directory<T>>
where T: Send + 'static,

Source

pub fn create_directory(&mut self, name: &str) -> Result<Directory<T>>
where T: Send + 'static,

Source

pub fn create_stream( &mut self, name: &str, frame_size: usize, ) -> Result<Stream<T>>

Source

pub fn open_directory_for_update(&self, name: &str) -> Result<Directory<T>>

Source§

impl<T: Read + Seek> Directory<T>

Source

pub fn entries(&self) -> Vec<Entry>

Get a list of children under this directory

Source

pub fn open_root(back: T, offset: u64) -> Result<Directory<T>>

Open an root directory from a seek-able backend stream and an absolute offset

Source

pub fn open_blob(&self, name: &str) -> Result<Blob<T>>

Source

pub fn open_stream_by_offset( &self, offset: u64, frame_size: usize, ) -> Result<Stream<T>>

Source

pub fn open_stream(&self, name: &str) -> Result<Stream<T>>

Source

pub fn open_directory(&self, name: &str) -> Result<Directory<T>>

Source

pub fn open<P: AsRef<Path>>(&self, path: P) -> Result<OpenResult<T>>

Source

pub fn recurse<Handle: FnMut(&Path, EntryKind) -> bool>(&self, handle: Handle)

Source

pub fn find_first_object(&self, name: &str) -> Option<PathBuf>

Trait Implementations§

Source§

impl<T> Clone for Directory<T>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Directory<T>

§

impl<T> RefUnwindSafe for Directory<T>

§

impl<T> Send for Directory<T>
where T: Send,

§

impl<T> Sync for Directory<T>
where T: Send,

§

impl<T> Unpin for Directory<T>

§

impl<T> UnwindSafe for Directory<T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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

Source§

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.