Enum swc_common::plugin::serialized::PluginError
source · #[non_exhaustive]pub enum PluginError {
SizeInteropFailure(String),
Deserialize(String),
Serialize(String),
}
__plugin
only.Expand description
Enum for possible errors while running transform via plugin.
This error indicates internal operation failure either in plugin_runner
or plugin_macro. Plugin’s transform fn itself does not allow to return
error - instead it should use provided handler
to emit corresponding error
to the host.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SizeInteropFailure(String)
Occurs when failed to convert size passed from host / guest into usize or similar for the conversion. This is an internal error rasied via plugin_macro, normally plugin author should not raise this manually.
Deserialize(String)
Occurs when failed to reconstruct a struct from Serialized
.
Serialize(String)
Occurs when failed to serialize a struct into Serialized
.
Unlike deserialize error, this error cannot forward any context for the
raw bytes: when serialize failed, there’s nothing we can pass between
runtime.
Trait Implementations§
source§impl Archive for PluginErrorwhere
String: Archive,
impl Archive for PluginErrorwhere String: Archive,
§type Archived = ArchivedPluginError
type Archived = ArchivedPluginError
§type Resolver = PluginErrorResolver
type Resolver = PluginErrorResolver
source§impl Clone for PluginError
impl Clone for PluginError
source§fn clone(&self) -> PluginError
fn clone(&self) -> PluginError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PluginError
impl Debug for PluginError
source§impl<__D: Fallible + ?Sized> Deserialize<PluginError, __D> for Archived<PluginError>where
String: Archive,
Archived<String>: Deserialize<String, __D>,
impl<__D: Fallible + ?Sized> Deserialize<PluginError, __D> for Archived<PluginError>where String: Archive, Archived<String>: Deserialize<String, __D>,
source§fn deserialize(&self, deserializer: &mut __D) -> Result<PluginError, __D::Error>
fn deserialize(&self, deserializer: &mut __D) -> Result<PluginError, __D::Error>
source§impl PartialEq<PluginError> for PluginError
impl PartialEq<PluginError> for PluginError
source§fn eq(&self, other: &PluginError) -> bool
fn eq(&self, other: &PluginError) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for PluginError
impl StructuralEq for PluginError
impl StructuralPartialEq for PluginError
Auto Trait Implementations§
impl RefUnwindSafe for PluginError
impl Send for PluginError
impl Sync for PluginError
impl Unpin for PluginError
impl UnwindSafe for PluginError
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata )
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
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.