Skip to main content

BCFS

Struct BCFS 

Source
pub struct BCFS { /* private fields */ }

Implementations§

Source§

impl BCFS

Source

pub fn new<S: AsRef<str>>(home_addr: Address, blockchain_name: S) -> Self

Creates a new fs for the account at home_addr.

Source

pub fn prestat( &mut self, _ptx: &mut dyn PendingTransaction, fd: Fd, ) -> Result<&Path, ErrNo>

Returns pre-opened dir fds. @see crate::file::special_file_ctor

Source

pub fn open( &mut self, ptx: &mut dyn PendingTransaction, curdir: Fd, path: &Path, open_flags: OpenFlags, fd_flags: FdFlags, ) -> Result<Fd, ErrNo>

Returns a capability to the resource at the given (relative!) path.

curdir is the root capability to which the path is relative.

The blockchain environment is exposed through files in /opt/<chain_name>/:

  • <address>/balance - contains the read-only public balance of the account at <address>
  • <address>/bytecode - contains the read-only Wasm bytecode of the account at <address>
  • log - an append-only file to which events can be written. @see BCFS::parse_log.

The user’s home directory is /opt/<chain_name>/<address>.

Source

pub fn tempfile( &mut self, _ptx: &mut dyn PendingTransaction, ) -> Result<Fd, ErrNo>

Source

pub fn flush( &mut self, ptx: &mut dyn PendingTransaction, fd: Fd, ) -> Result<(), ErrNo>

Source

pub fn close( &mut self, ptx: &mut dyn PendingTransaction, fd: Fd, ) -> Result<(), ErrNo>

Removes the file at path and returns the number of bytes previously in the file.

Source

pub fn seek( &mut self, ptx: &mut dyn PendingTransaction, fd: Fd, offset: FileDelta, whence: Whence, ) -> Result<FileSize, ErrNo>

Source

pub fn fdstat( &self, _ptx: &mut dyn PendingTransaction, fd: Fd, ) -> Result<FdStat, ErrNo>

Source

pub fn filestat( &self, ptx: &dyn PendingTransaction, fd: Fd, ) -> Result<FileStat, ErrNo>

Source

pub fn tell( &self, ptx: &mut dyn PendingTransaction, fd: Fd, ) -> Result<FileSize, ErrNo>

Source

pub fn read_vectored( &mut self, ptx: &mut dyn PendingTransaction, fd: Fd, bufs: &mut [IoSliceMut<'_>], ) -> Result<usize, ErrNo>

Source

pub fn pread_vectored( &self, ptx: &mut dyn PendingTransaction, fd: Fd, bufs: &mut [IoSliceMut<'_>], offset: FileSize, ) -> Result<usize, ErrNo>

Source

pub fn write_vectored( &mut self, ptx: &mut dyn PendingTransaction, fd: Fd, bufs: &[IoSlice<'_>], ) -> Result<usize, ErrNo>

Source

pub fn pwrite_vectored( &mut self, ptx: &mut dyn PendingTransaction, fd: Fd, bufs: &[IoSlice<'_>], offset: FileSize, ) -> Result<usize, ErrNo>

Source

pub fn renumber( &mut self, _ptx: &mut dyn PendingTransaction, fd: Fd, new_fd: Fd, ) -> Result<(), ErrNo>

Auto Trait Implementations§

§

impl Freeze for BCFS

§

impl !RefUnwindSafe for BCFS

§

impl Send for BCFS

§

impl !Sync for BCFS

§

impl Unpin for BCFS

§

impl UnsafeUnpin for BCFS

§

impl UnwindSafe for BCFS

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

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.