pub enum DesktopResponseContent {
Bytes(DesktopResponseBody),
File(DesktopResponseFile),
}Expand description
Owned protocol content. Files retain an open handle and a fixed delivery length; native adapters must not reopen their paths or eagerly buffer them.
Variants§
Bytes(DesktopResponseBody)
Bytes, including any IPC response-lifetime reservation.
File(DesktopResponseFile)
An already-opened, length-bounded file.
Implementations§
Source§impl DesktopResponseContent
impl DesktopResponseContent
Sourcepub fn as_bytes(&self) -> Option<&DesktopResponseBody>
pub fn as_bytes(&self) -> Option<&DesktopResponseBody>
Borrow buffered bytes. File responses return None without performing I/O.
Sourcepub fn into_bytes(self) -> Result<DesktopResponseBody>
pub fn into_bytes(self) -> Result<DesktopResponseBody>
Materialize content explicitly for a non-native consumer.
§Errors
Returns an I/O error if reading a file fails or its contents were truncated.
Trait Implementations§
Source§impl Debug for DesktopResponseContent
impl Debug for DesktopResponseContent
Source§impl From<DesktopResponseBody> for DesktopResponseContent
impl From<DesktopResponseBody> for DesktopResponseContent
Source§fn from(bytes: DesktopResponseBody) -> Self
fn from(bytes: DesktopResponseBody) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for DesktopResponseContent
impl !UnwindSafe for DesktopResponseContent
impl Freeze for DesktopResponseContent
impl Send for DesktopResponseContent
impl Sync for DesktopResponseContent
impl Unpin for DesktopResponseContent
impl UnsafeUnpin for DesktopResponseContent
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