pub enum GuestBinary<'a> {
Buffer(&'a [u8]),
FilePath(String),
}Expand description
A GuestBinary is either a buffer or the file path to some data (e.g., a guest binary).
Variants§
Implementations§
Source§impl<'a> GuestBinary<'a>
impl<'a> GuestBinary<'a>
Sourcepub fn canonicalize(&mut self) -> Result<()>
pub fn canonicalize(&mut self) -> Result<()>
If the guest binary is identified by a file, canonicalise the path
For GuestBinary::FilePath, this resolves the path to its canonical
form. For GuestBinary::Buffer, this method is a no-op.
TODO: Maybe we should make the GuestEnvironment or
GuestBinary constructors crate-private and turn this
into an invariant on one of those types.
Trait Implementations§
Source§impl<'a> Debug for GuestBinary<'a>
impl<'a> Debug for GuestBinary<'a>
Source§impl<'a> From<GuestBinary<'a>> for GuestEnvironment<'a, '_>
impl<'a> From<GuestBinary<'a>> for GuestEnvironment<'a, '_>
Source§fn from(guest_binary: GuestBinary<'a>) -> Self
fn from(guest_binary: GuestBinary<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for GuestBinary<'a>
impl<'a> RefUnwindSafe for GuestBinary<'a>
impl<'a> Send for GuestBinary<'a>
impl<'a> Sync for GuestBinary<'a>
impl<'a> Unpin for GuestBinary<'a>
impl<'a> UnsafeUnpin for GuestBinary<'a>
impl<'a> UnwindSafe for GuestBinary<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.