pub struct UniversalExecutableRef<'a> { /* private fields */ }
Expand description
A 0-copy view of the encoded UniversalExecutable
payload.
Implementations§
Source§impl<'a> UniversalExecutableRef<'a>
impl<'a> UniversalExecutableRef<'a>
Sourcepub fn verify_serialized(data: &[u8]) -> Result<(), &'static str>
pub fn verify_serialized(data: &[u8]) -> Result<(), &'static str>
Verify the buffer for whether it is a valid UniversalExecutable
.
Sourcepub unsafe fn deserialize(
data: &'a [u8],
) -> Result<UniversalExecutableRef<'a>, DeserializeError>
pub unsafe fn deserialize( data: &'a [u8], ) -> Result<UniversalExecutableRef<'a>, DeserializeError>
§Safety
This method is unsafe since it deserializes data directly
from memory.
Right now we are not doing any extra work for validation, but
rkyv
has an option to do bytecheck on the serialized data before
serializing (via rkyv::check_archived_value
).
Sourcepub fn to_owned(self) -> Result<UniversalExecutable, DeserializeError>
pub fn to_owned(self) -> Result<UniversalExecutable, DeserializeError>
Convert this reference to an owned UniversalExecutable
value.
Trait Implementations§
Source§impl<'a> Clone for UniversalExecutableRef<'a>
impl<'a> Clone for UniversalExecutableRef<'a>
Source§fn clone(&self) -> UniversalExecutableRef<'a>
fn clone(&self) -> UniversalExecutableRef<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Deref for UniversalExecutableRef<'a>
impl<'a> Deref for UniversalExecutableRef<'a>
Source§impl<'a> Executable for UniversalExecutableRef<'a>
impl<'a> Executable for UniversalExecutableRef<'a>
Source§fn load(
&self,
engine: &(dyn Engine + 'static),
) -> Result<Arc<dyn Artifact>, CompileError>
fn load( &self, engine: &(dyn Engine + 'static), ) -> Result<Arc<dyn Artifact>, CompileError>
Load this executable with the specified engine. Read more
Source§fn cpu_features(&self) -> EnumSet<CpuFeature>
fn cpu_features(&self) -> EnumSet<CpuFeature>
The CPU features this
Executable
requires.Source§fn serialize(&self) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>
fn serialize(&self) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>
Serializes the artifact into bytes
Source§fn function_name(&self, index: FunctionIndex) -> Option<&str>
fn function_name(&self, index: FunctionIndex) -> Option<&str>
Obtain a best effort description for the function at the given function index. Read more
impl<'a> Copy for UniversalExecutableRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for UniversalExecutableRef<'a>
impl<'a> RefUnwindSafe for UniversalExecutableRef<'a>
impl<'a> Send for UniversalExecutableRef<'a>
impl<'a> Sync for UniversalExecutableRef<'a>
impl<'a> Unpin for UniversalExecutableRef<'a>
impl<'a> UnwindSafe for UniversalExecutableRef<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§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