#[non_exhaustive]pub enum IpcReadHandle {
File(IpcFileHandle),
Bytes(IpcBytes),
}Expand description
File handle or allocated bytes that can be read after sending to another process.
§Position
Read always starts from the beginning, the read methods seek the file start before returning. Note
that the read position is associated with the system handle, if you create multiple duplicates of the
same handle reading in one instance advances the position in all.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl IpcReadHandle
impl IpcReadHandle
Sourcepub fn best_read_blocking(file: File) -> Result<Self>
pub fn best_read_blocking(file: File) -> Result<Self>
Either keep the handle or read to bytes, whichever is likely to be faster for the common usage pattern of sending to another process and a single full read with some seeking.
Sourcepub async fn best_read(file: File) -> Result<Self>
pub async fn best_read(file: File) -> Result<Self>
Either keep the handle or read to bytes, whichever is likely to be faster for the common usage pattern of sending to another process and a single full read with some seeking.
Sourcepub fn read_blocking(self) -> Result<IpcReadBlocking>
pub fn read_blocking(self) -> Result<IpcReadBlocking>
Begin reading using the std blocking API.
Sourcepub fn read_to_bytes_blocking(self) -> Result<IpcBytes>
pub fn read_to_bytes_blocking(self) -> Result<IpcBytes>
Read file to new IpcBytes or unwrap bytes.
Sourcepub async fn read_to_bytes(self) -> Result<IpcBytes>
pub async fn read_to_bytes(self) -> Result<IpcBytes>
Read file to new IpcBytes or unwrap bytes.
Sourcepub async fn duplicate_or_read(&mut self) -> Result<Self>
pub async fn duplicate_or_read(&mut self) -> Result<Self>
Attempts duplicate with read fallback.
If duplicate fails attempts read_to_bytes, if it succeeds replaces self with read bytes and returns a clone
if it fails replaces self with empty and returns the read error.
Sourcepub fn duplicate_or_read_blocking(&mut self) -> Result<Self>
pub fn duplicate_or_read_blocking(&mut self) -> Result<Self>
Attempts duplicate with read fallback.
If duplicate fails attempts read_to_bytes_blocking, if it succeeds replaces self with read bytes and returns a clone
if it fails replaces self with empty and returns the read error.
Trait Implementations§
Source§impl Debug for IpcReadHandle
impl Debug for IpcReadHandle
Source§impl<'de> Deserialize<'de> for IpcReadHandle
impl<'de> Deserialize<'de> for IpcReadHandle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<File> for IpcReadHandle
impl From<File> for IpcReadHandle
Source§impl From<IpcBytes> for IpcReadHandle
impl From<IpcBytes> for IpcReadHandle
Source§impl From<IpcFileHandle> for IpcReadHandle
impl From<IpcFileHandle> for IpcReadHandle
Source§fn from(f: IpcFileHandle) -> Self
fn from(f: IpcFileHandle) -> Self
Auto Trait Implementations§
impl Freeze for IpcReadHandle
impl RefUnwindSafe for IpcReadHandle
impl Send for IpcReadHandle
impl Sync for IpcReadHandle
impl Unpin for IpcReadHandle
impl UnsafeUnpin for IpcReadHandle
impl UnwindSafe for IpcReadHandle
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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