[−][src]Struct over_there_core::LocalFile
Methods
impl LocalFile
[src]
pub async fn open(
path: impl AsRef<Path>,
create: bool,
write: bool,
read: bool
) -> Result<Self>
[src]
path: impl AsRef<Path>,
create: bool,
write: bool,
read: bool
) -> Result<Self>
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]
&'_ mut self,
sig: u32,
to: impl AsRef<Path>
) -> Result<u32, LocalFileError>
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]
&'_ mut self,
sig: u32
) -> Result<Vec<u8>, LocalFileError>
Reads all contents of file from beginning to end
pub async fn write_all<'_, '_>(
&'_ mut self,
sig: u32,
buf: &'_ [u8]
) -> Result<(), LocalFileError>
[src]
&'_ mut self,
sig: u32,
buf: &'_ [u8]
) -> Result<(), LocalFileError>
Overwrites contents of file with provided contents
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for LocalFile
impl Send for LocalFile
impl Sync for LocalFile
impl Unpin for LocalFile
impl !UnwindSafe for LocalFile
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,