Struct swc_common::plugin::serialized::PluginSerializedBytes
source · pub struct PluginSerializedBytes { /* private fields */ }
Available on crate feature
__plugin
only.Expand description
Wraps internal representation of serialized data for exchanging data between plugin to the host. Consumers should not rely on specific details of byte format struct contains: it is strict implementation detail which can change anytime.
Implementations§
source§impl PluginSerializedBytes
impl PluginSerializedBytes
sourcepub fn from_slice(bytes: &[u8]) -> PluginSerializedBytes
pub fn from_slice(bytes: &[u8]) -> PluginSerializedBytes
- Constructs an instance from already serialized byte
- slices.
sourcepub fn try_serialize<W>(t: &VersionedSerializable<W>) -> Result<Self, Error>where
W: Serialize<AllocSerializer<512>>,
pub fn try_serialize<W>(t: &VersionedSerializable<W>) -> Result<Self, Error>where W: Serialize<AllocSerializer<512>>,
- Constructs an instance from versioned struct by serializing it.
- This is sort of mimic TryFrom behavior, since we can’t use generic
- to implement TryFrom trait
pub fn from_raw_ptr( raw_allocated_ptr: *const u8, raw_allocated_ptr_len: usize ) -> PluginSerializedBytes
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_ptr(&self) -> (*const u8, usize)
pub fn deserialize<W>(&self) -> Result<VersionedSerializable<W>, Error>where W: Archive, W::Archived: Deserialize<W, SharedDeserializeMap>,
Auto Trait Implementations§
impl RefUnwindSafe for PluginSerializedBytes
impl Send for PluginSerializedBytes
impl Sync for PluginSerializedBytes
impl Unpin for PluginSerializedBytes
impl UnwindSafe for PluginSerializedBytes
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
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> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.