Struct btfproto::client::FsClient

source ·
pub struct FsClient { /* private fields */ }
Expand description

A struct which can be used to perform filesystem operations on a remote server.

Implementations§

source§

impl FsClient

source

pub fn new(tx: Transmitter) -> Self

Creates a new FsClient which sends all filesystem operations to the server using the given Transmitter.

source

pub fn into_inner(self) -> Transmitter

source

pub fn get_ref(&self) -> &Transmitter

source

pub fn get_mut(&mut self) -> &mut Transmitter

source§

impl FsClient

source

pub async fn lookup(&self, parent: Inode, name: &str) -> Result<LookupReply>

Lookup up the given name under the given inode.

source

pub async fn create( &self, parent: Inode, name: &str, flags: Flags, mode: u32, umask: u32 ) -> Result<CreateReply>

source

pub async fn open(&self, inode: Inode, flags: Flags) -> Result<OpenReply>

source

pub async fn read<R, Fut, F>( &self, inode: Inode, handle: Handle, offset: u64, size: u64, callback: F ) -> Result<R>where F: 'static + Send + FnOnce(ReadReply<'_>) -> Fut, Fut: Send + Future<Output = R>,

source

pub async fn write( &self, inode: Inode, handle: Handle, offset: u64, data: &[u8] ) -> Result<WriteReply>

source

pub async fn flush(&self, inode: Inode, handle: Handle) -> Result<()>

source

pub async fn read_dir( &self, inode: Inode, handle: Handle, limit: u32, state: u64 ) -> Result<ReadDirReply>

source

pub async fn read_meta( &self, inode: Inode, handle: Option<Handle> ) -> Result<ReadMetaReply>

source

pub async fn write_meta( &self, inode: Inode, handle: Option<Handle>, attrs: Attrs, attrs_set: AttrsSet ) -> Result<WriteMetaReply>

source

pub async fn allocate( &self, inode: Inode, handle: Handle, size: u64 ) -> Result<()>

source

pub async fn close(&self, inode: Inode, handle: Handle) -> Result<()>

source

pub async fn forget(&self, inode: Inode, count: u64) -> Result<()>

source

pub async fn lock( &self, inode: Inode, handle: Handle, desc: LockDesc ) -> Result<()>

source

pub async fn unlock(&self, inode: Inode, handle: Handle) -> Result<()>

source

pub async fn add_readcap( &self, inode: Inode, handle: Handle, pub_creds: ConcretePub ) -> Result<()>

source

pub async fn grant_access( &self, inode: Inode, record: IssuedProcRec ) -> Result<()>

Trait Implementations§

source§

impl AsMut<Transmitter> for FsClient

source§

fn as_mut(&mut self) -> &mut Transmitter

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<Transmitter> for FsClient

source§

fn as_ref(&self) -> &Transmitter

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl From<Transmitter> for FsClient

source§

fn from(value: Transmitter) -> Self

Converts to this type from the input type.
source§

impl FsProvider for FsClient

§

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 = Vec<u8, Global>

§

type ReadFut<'c> = impl Send + Future<Output = Result<<FsClient 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>, msg: 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> = impl Send + Future<Output = Result<(), Error>> + 'c

source§

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

§

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

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>

Auto Trait Implementations§

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