pub struct File {
fd: Arc<SafeDescriptor>,
}
Fields
fd: Arc<SafeDescriptor>
Implementations
sourceimpl File
impl File
pub fn open<P: AsRef<Path>>(p: P) -> Result<File>
pub fn create<P: AsRef<Path>>(p: P) -> Result<File>
pub async fn read(&self, buf: &mut [u8], offset: Option<u64>) -> Result<usize>
pub async fn read_iobuf<B: AsIoBufs + Unpin + 'static>(
&self,
buf: B,
offset: Option<u64>
) -> (Result<usize>, B)
pub async fn write(&self, buf: &[u8], offset: Option<u64>) -> Result<usize>
pub async fn write_iobuf<B: AsIoBufs + Unpin + 'static>(
&self,
buf: B,
offset: Option<u64>
) -> (Result<usize>, B)
pub async fn punch_hole(&self, offset: u64, len: u64) -> Result<()>
pub async fn write_zeroes(&self, offset: u64, len: u64) -> Result<()>
pub async fn allocate(&self, offset: u64, len: u64) -> Result<()>
pub async fn get_len(&self) -> Result<u64>
pub async fn set_len(&self, len: u64) -> Result<()>
pub async fn sync_all(&self) -> Result<()>
pub async fn sync_data(&self) -> Result<()>
pub fn try_clone(&self) -> Result<File>
Trait Implementations
sourceimpl AsRawDescriptor for File
impl AsRawDescriptor for File
sourcefn as_raw_descriptor(&self) -> RawDescriptor
fn as_raw_descriptor(&self) -> RawDescriptor
Returns the underlying raw descriptor. Read more
Auto Trait Implementations
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more