#[non_exhaustive]pub enum PlatformError {
NoPlatform,
NoEventLoopProvider,
SetPlatformError(SetPlatformError),
Other(String),
OtherError(Box<dyn Error + Send + Sync>),
}
Expand description
The platform encountered a fatal error.
This error typically indicates an issue with initialization or connecting to the windowing system.
This can be constructed from a String
:
use slint::platform::PlatformError;
PlatformError::from(format!("Could not load resource {}", 1234));
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoPlatform
No default platform was selected, or no platform could be initialized.
If you encounter this error, make sure to either selected trough the backend-*
cargo features flags,
or call platform::set_platform()
before running the event loop
NoEventLoopProvider
The Slint Platform does not provide an event loop.
The Platform::run_event_loop
is not implemented for the current platform.
SetPlatformError(SetPlatformError)
There is already a platform set from another thread.
Other(String)
Another platform-specific error occurred
OtherError(Box<dyn Error + Send + Sync>)
Another platform-specific error occurred.
Trait Implementations§
Source§impl Debug for PlatformError
impl Debug for PlatformError
Source§impl Display for PlatformError
impl Display for PlatformError
Source§impl Error for PlatformError
impl Error for PlatformError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<&str> for PlatformError
impl From<&str> for PlatformError
Auto Trait Implementations§
impl Freeze for PlatformError
impl !RefUnwindSafe for PlatformError
impl Send for PlatformError
impl Sync for PlatformError
impl Unpin for PlatformError
impl !UnwindSafe for PlatformError
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
Converts the given value to a
SharedString
.