⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

NfsClient

Struct NfsClient 

Source
pub struct NfsClient { /* private fields */ }
Expand description

NFS v4 client.

Implementations§

Source§

impl NfsClient

Source

pub fn new(server_addr: String) -> Self

Create a new NFS client for the given server.

Source

pub fn set_auth(&mut self, uid: u32, gid: u32, machine_name: String)

Set authentication credentials.

Source

pub fn mount(&mut self) -> Result<NfsFileHandle, NfsError>

Mount the NFS export (PUTROOTFH + GETFH).

Source

pub fn lookup( &mut self, dir_fh: &NfsFileHandle, name: &str, ) -> Result<NfsFileHandle, NfsError>

Lookup a name relative to a directory file handle.

Source

pub fn read( &mut self, fh: &NfsFileHandle, offset: u64, count: u32, ) -> Result<(Vec<u8>, bool), NfsError>

Read data from a file.

Source

pub fn write( &mut self, fh: &NfsFileHandle, offset: u64, data: &[u8], stable: bool, ) -> Result<(u32, bool), NfsError>

Write data to a file.

Source

pub fn readdir( &mut self, dir_fh: &NfsFileHandle, cookie: u64, count: u32, ) -> Result<Vec<NfsDirEntry>, NfsError>

Read directory entries.

Source

pub fn create( &mut self, dir_fh: &NfsFileHandle, name: &str, file_type: NfsFtype, ) -> Result<NfsFileHandle, NfsError>

Create a file or directory.

Source

pub fn remove( &mut self, dir_fh: &NfsFileHandle, name: &str, ) -> Result<(), NfsError>

Remove a file or directory.

Source

pub fn getattr(&mut self, fh: &NfsFileHandle) -> Result<NfsAttr, NfsError>

Get file attributes.

Source

pub fn setattr( &mut self, fh: &NfsFileHandle, attrs: NfsAttr, ) -> Result<(), NfsError>

Set file attributes.

Source

pub fn build_compound(&self, req: &CompoundRequest) -> Vec<u8>

Build an XDR-encoded compound request.

Source

pub fn parse_compound(&self, data: &[u8]) -> Result<CompoundResponse, NfsError>

Parse an XDR-encoded compound response.

Source

pub fn root_fh(&self) -> &NfsFileHandle

Get the root file handle.

Source

pub fn current_fh(&self) -> &NfsFileHandle

Get the current file handle.

Source

pub fn server_addr(&self) -> &str

Get the server address.

Auto Trait Implementations§

§

impl Freeze for NfsClient

§

impl RefUnwindSafe for NfsClient

§

impl Send for NfsClient

§

impl Sync for NfsClient

§

impl Unpin for NfsClient

§

impl UnwindSafe for NfsClient

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.