Struct TruncateFile
pub struct TruncateFile<S>where
S: AsFd,{ /* private fields */ }Expand description
Truncates or extends the underlying file, updating the size of this file to
become size.
Implementations§
§impl<S> TruncateFile<S>where
S: AsFd,
impl<S> TruncateFile<S>where
S: AsFd,
pub fn new(fd: S, size: u64) -> TruncateFile<S>
pub fn new(fd: S, size: u64) -> TruncateFile<S>
Create TruncateFile.
Trait Implementations§
§impl<S> Debug for TruncateFile<S>
impl<S> Debug for TruncateFile<S>
§impl<S> OpCode for TruncateFile<S>where
S: AsFd,
impl<S> OpCode for TruncateFile<S>where
S: AsFd,
§fn create_entry(self: Pin<&mut TruncateFile<S>>) -> OpEntry
fn create_entry(self: Pin<&mut TruncateFile<S>>) -> OpEntry
Create submission entry.
§fn call_blocking(self: Pin<&mut TruncateFile<S>>) -> Result<usize, Error>
fn call_blocking(self: Pin<&mut TruncateFile<S>>) -> Result<usize, Error>
Call the operation in a blocking way. This method will only be called if
create_entry returns OpEntry::Blocking.§unsafe fn set_result(self: Pin<&mut Self>, _: usize)
unsafe fn set_result(self: Pin<&mut Self>, _: usize)
Set the result when it successfully completes.
The operation stores the result and is responsible to release it if the
operation is cancelled. Read more
§impl<S> OpCode for TruncateFile<S>where
S: AsFd,
impl<S> OpCode for TruncateFile<S>where
S: AsFd,
§fn pre_submit(self: Pin<&mut TruncateFile<S>>) -> Result<Decision, Error>
fn pre_submit(self: Pin<&mut TruncateFile<S>>) -> Result<Decision, Error>
Perform the operation before submit, and return
Decision to
indicate whether submitting the operation to polling is required.§fn operate(self: Pin<&mut TruncateFile<S>>) -> Poll<Result<usize, Error>>
fn operate(self: Pin<&mut TruncateFile<S>>) -> Poll<Result<usize, Error>>
Perform the operation after received corresponding
event. If this operation is blocking, the return value should be
Poll::Ready.Auto Trait Implementations§
impl<S> Freeze for TruncateFile<S>where
S: Freeze,
impl<S> RefUnwindSafe for TruncateFile<S>where
S: RefUnwindSafe,
impl<S> Send for TruncateFile<S>where
S: Send,
impl<S> Sync for TruncateFile<S>where
S: Sync,
impl<S> Unpin for TruncateFile<S>where
S: Unpin,
impl<S> UnwindSafe for TruncateFile<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more