#[non_exhaustive]pub enum NativeWidgetError {
PlatformNotInitialized,
Params(String),
UnknownControl(String),
Platform(String),
}Expand description
Errors from a native-widgets operation.
thiserror-derived per docs/CODE_STANDARDS.md: callers match on the
variant (e.g. distinguishing Self::PlatformNotInitialized from a
generic Self::Platform failure) rather than only displaying it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PlatformNotInitialized
This platform has no native-widgets backend (desktop preview, wasm),
or an Android scaffold predating nativeInitPlatform — the same
fail-soft contract every other platform plugin uses
(docs/CODE_STANDARDS.md’s Plugin Conventions), never a panic.
Params(String)
A slot’s params_json could not be read: the reserved identity keys
are missing, a required field is absent or malformed, or the params
name a different control than the live instance. Distinguishable from
Self::Platform because it is an api-layer/runtime contract
violation, never a platform failure.
UnknownControl(String)
No NativeWidget is registered under the control kind a slot’s params
name — a control the app’s build never registered (or a params payload
from a different plugin version).
Platform(String)
A backend-specific failure not covered by a more specific variant (a JNI error, an unexpected ObjC runtime failure).
Trait Implementations§
Source§impl Debug for NativeWidgetError
impl Debug for NativeWidgetError
Source§impl Display for NativeWidgetError
impl Display for NativeWidgetError
Source§impl Error for NativeWidgetError
impl Error for NativeWidgetError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for NativeWidgetError
impl RefUnwindSafe for NativeWidgetError
impl Send for NativeWidgetError
impl Sync for NativeWidgetError
impl Unpin for NativeWidgetError
impl UnsafeUnpin for NativeWidgetError
impl UnwindSafe for NativeWidgetError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.