Struct btfproto::local_fs::LocalFs

source ·
pub struct LocalFs<A> { /* private fields */ }
Expand description

A struct for managing the part of a blocktree stored in the local filesystem.

Implementations§

source§

impl<A: Authorizer> LocalFs<A>

source

pub async fn new_empty( btdir: PathBuf, generation: u64, creds: Arc<dyn Creds>, authorizer: A ) -> Result<LocalFs<A>>

Creates a new empty blocktree at the given path.

source

pub fn new_existing( btdir: PathBuf, creds: Arc<dyn Creds>, authorizer: A ) -> Result<LocalFs<A>>

Opens an existing blocktree stored at the given path.

Trait Implementations§

source§

impl<A: 'static + Authorizer + Send + Sync> FsProvider for LocalFs<A>

§

type LookupFut<'c> = impl Send + Future<Output = Result<LookupReply, Error>> + 'c

source§

fn lookup<'c>( &'c self, from: &'c Arc<BlockPath>, msg: Lookup<'c> ) -> Self::LookupFut<'c>

§

type CreateFut<'c> = impl Send + Future<Output = Result<CreateReply, Error>> + 'c

source§

fn create<'c>( &'c self, from: &'c Arc<BlockPath>, msg: Create<'c> ) -> Self::CreateFut<'c>

§

type OpenFut<'c> = impl Send + Future<Output = Result<OpenReply, Error>> + 'c

source§

fn open<'c>(&'c self, from: &'c Arc<BlockPath>, msg: Open) -> Self::OpenFut<'c>

§

type ReadGuard = BufGuard

§

type ReadFut<'c> = impl Send + Future<Output = Result<<LocalFs<A> as FsProvider>::ReadGuard, Error>> + 'c

source§

fn read<'c>(&'c self, from: &'c Arc<BlockPath>, msg: Read) -> Self::ReadFut<'c>

Reads from the file specified in the given message. Read more
§

type WriteFut<'r> = impl Send + Future<Output = Result<WriteReply, Error>> + 'r

source§

fn write<'c>( &'c self, from: &'c Arc<BlockPath>, write: Write<&'c [u8]> ) -> Self::WriteFut<'c>

§

type FlushFut<'c> = impl Send + Future<Output = Result<(), Error>> + 'c

source§

fn flush<'c>( &'c self, from: &'c Arc<BlockPath>, msg: Flush ) -> Self::FlushFut<'c>

§

type ReadDirFut<'c> = impl Send + Future<Output = Result<ReadDirReply, Error>> + 'c

source§

fn read_dir<'c>( &'c self, from: &'c Arc<BlockPath>, msg: ReadDir ) -> Self::ReadDirFut<'c>

§

type LinkFut<'c> = impl Send + Future<Output = Result<LinkReply, Error>> + 'c

§

type UnlinkFut<'c> = impl Send + Future<Output = Result<(), Error>> + 'c

§

type ReadMetaFut<'c> = impl Send + Future<Output = Result<ReadMetaReply, Error>> + 'c

source§

fn read_meta<'c>( &'c self, from: &'c Arc<BlockPath>, msg: ReadMeta ) -> Self::ReadMetaFut<'c>

§

type WriteMetaFut<'c> = impl Send + Future<Output = Result<WriteMetaReply, Error>> + 'c

source§

fn write_meta<'c>( &'c self, from: &'c Arc<BlockPath>, msg: WriteMeta ) -> Self::WriteMetaFut<'c>

§

type AllocateFut<'c> = impl Send + Future<Output = Result<(), Error>> + 'c

source§

fn allocate<'c>( &'c self, from: &'c Arc<BlockPath>, msg: Allocate ) -> Self::AllocateFut<'c>

§

type CloseFut<'c> = impl Send + Future<Output = Result<(), Error>> + 'c

source§

fn close<'c>( &'c self, from: &'c Arc<BlockPath>, msg: Close ) -> Self::CloseFut<'c>

§

type ForgetFut<'c> = impl Send + Future<Output = Result<(), Error>> + 'c

source§

fn forget<'c>( &'c self, from: &'c Arc<BlockPath>, msg: Forget ) -> Self::ForgetFut<'c>

§

type LockFut<'c> = Ready<Result<(), Error>>

source§

fn lock<'c>( &'c self, _from: &'c Arc<BlockPath>, _msg: Lock ) -> Self::LockFut<'c>

§

type UnlockFut<'c> = Ready<Result<(), Error>>

source§

fn unlock<'c>( &'c self, _from: &'c Arc<BlockPath>, _msg: Unlock ) -> Self::UnlockFut<'c>

§

type AddReacapFut<'c> = impl Send + Future<Output = Result<(), Error>> + 'c

source§

fn add_readcap<'c>( &'c self, from: &'c Arc<BlockPath>, msg: AddReadcap ) -> Self::AddReacapFut<'c>

§

type GrantAccessFut<'c> = impl Send + Future<Output = Result<(), Error>> + 'c

source§

fn grant_access<'c>( &'c self, from: &'c Arc<BlockPath>, msg: GrantAccess ) -> Self::GrantAccessFut<'c>

source§

impl<A: Sync> Sync for LocalFs<A>

Auto Trait Implementations§

§

impl<A> !RefUnwindSafe for LocalFs<A>

§

impl<A> Send for LocalFs<A>where A: Send,

§

impl<A> Unpin for LocalFs<A>where A: Unpin,

§

impl<A> !UnwindSafe for LocalFs<A>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Free for T

§

unsafe default fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere 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 Twhere 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.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more