[][src]Struct over_there_core::LocalFile

pub struct LocalFile { /* fields omitted */ }

Methods

impl LocalFile[src]

pub async fn open(
    path: impl AsRef<Path>,
    create: bool,
    write: bool,
    read: bool
) -> Result<Self>
[src]

Opens up a file at path. Will create the file if `create is true, otherwise will fail if missing.

  • Read permission is set by read.
  • Write permission is set by write.

Internally, the path will be canonicalized to a resolved, absolute path that can be used as reference when examining the local file.

pub fn id(&self) -> u32[src]

pub fn sig(&self) -> u32[src]

pub fn handle(&self) -> LocalFileHandle[src]

pub fn permissions(&self) -> LocalFilePermissions[src]

pub fn path(&self) -> &Path[src]

pub async fn rename<'_>(
    &'_ mut self,
    sig: u32,
    to: impl AsRef<Path>
) -> Result<u32, LocalFileError>
[src]

Renames a file (if possible) using its underlying path as the origin

pub async fn remove<'_>(&'_ mut self, sig: u32) -> Result<(), LocalFileError>[src]

Removes the file (if possible) using its underlying path

NOTE: If successful, this makes the local file reference no longer usable for the majority of its functionality

pub async fn read_all<'_>(
    &'_ mut self,
    sig: u32
) -> Result<Vec<u8>, LocalFileError>
[src]

Reads all contents of file from beginning to end

pub async fn write_all<'_, '_>(
    &'_ mut self,
    sig: u32,
    buf: &'_ [u8]
) -> Result<(), LocalFileError>
[src]

Overwrites contents of file with provided contents

Trait Implementations

impl Debug for LocalFile[src]

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

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.

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