[][src]Struct bcfs::BCFS

pub struct BCFS { /* fields omitted */ }

Methods

impl BCFS[src]

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

Creates a new fs for the account at home_addr.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Auto Trait Implementations

impl !RefUnwindSafe for BCFS

impl Send for BCFS

impl !Sync for BCFS

impl Unpin for BCFS

impl UnwindSafe for BCFS

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.