pub struct EncodableBlob {
pub metadata_bytes: Vec<u8>,
pub instructions_bytes: Vec<u8>,
pub constants_bytes: Vec<u8>,
pub strings_bytes: Vec<u8>,
pub dependencies_bytes: Vec<u8>,
pub type_schemas_bytes: Vec<u8>,
pub source_map_bytes: Vec<u8>,
pub permissions_bytes: Vec<u8>,
}Expand description
A blob prepared for wire-format encoding.
This struct holds pre-serialized section payloads so that the encoder does
not need to depend on shape-vm types. Higher-level code (typically in
shape-vm) converts a FunctionBlob into an EncodableBlob.
Fields§
§metadata_bytes: Vec<u8>Msgpack-encoded BlobMetadata.
instructions_bytes: Vec<u8>Msgpack-encoded instructions (opaque to this module).
constants_bytes: Vec<u8>Msgpack-encoded constants (opaque to this module).
strings_bytes: Vec<u8>Msgpack-encoded string pool.
dependencies_bytes: Vec<u8>Flat concatenation of 32-byte dependency hashes.
type_schemas_bytes: Vec<u8>Msgpack-encoded type schema names.
source_map_bytes: Vec<u8>Msgpack-encoded source map entries.
permissions_bytes: Vec<u8>Msgpack-encoded permission names.
Implementations§
Source§impl EncodableBlob
impl EncodableBlob
Sourcepub fn from_parts(
metadata: &BlobMetadata,
instructions: &impl Serialize,
constants: &impl Serialize,
strings: &[String],
dependency_hashes: &[[u8; 32]],
type_schemas: &[String],
source_map: &[(usize, u32, u32)],
permission_names: &[&str],
) -> Result<Self, WireFormatError>
pub fn from_parts( metadata: &BlobMetadata, instructions: &impl Serialize, constants: &impl Serialize, strings: &[String], dependency_hashes: &[[u8; 32]], type_schemas: &[String], source_map: &[(usize, u32, u32)], permission_names: &[&str], ) -> Result<Self, WireFormatError>
Build an EncodableBlob from individual fields.
This is the convenience constructor when you already have the decoded data available. Each field is msgpack-serialized here.
Trait Implementations§
Source§impl Clone for EncodableBlob
impl Clone for EncodableBlob
Source§fn clone(&self) -> EncodableBlob
fn clone(&self) -> EncodableBlob
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for EncodableBlob
impl RefUnwindSafe for EncodableBlob
impl Send for EncodableBlob
impl Sync for EncodableBlob
impl Unpin for EncodableBlob
impl UnsafeUnpin for EncodableBlob
impl UnwindSafe for EncodableBlob
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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