pub struct AutoBackend(/* private fields */);Implementations§
Source§impl AutoBackend
impl AutoBackend
Sourcepub fn set_preferences(preferences: &'static [Backend])
pub fn set_preferences(preferences: &'static [Backend])
Sets which backends the AutoBackend will select from and in what order they are selected.
Default: [Win32, AppKit, Wayland, X11, Web, Android, UIKit,]
Trait Implementations§
Source§impl Backend for AutoBackend
impl Backend for AutoBackend
Source§fn instance() -> Option<&'static AutoBackend>where
AutoBackend: Sized,
fn instance() -> Option<&'static AutoBackend>where
AutoBackend: Sized,
This should return a reference to a static instance of the backend, as opposed to creating a new instance every time.
This is because some backends may need to maintain global state.
This should also return
None if the backend is not implemented on the current platform.Source§fn is_available() -> boolwhere
AutoBackend: Sized,
fn is_available() -> boolwhere
AutoBackend: Sized,
This should be a quick check to see if the backend is available on the current platform. One should implement this with
compile-time cfg checks and env var checks as necessary. Then, use cfgs to avoid compiling the methods of the backend if
it is not available. Read more
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
The name of the backend, used for logging and debugging purposes.
fn create_window( &self, settings: WindowSettings, ) -> Result<Arc<dyn BackendWindow>, RequestError>
fn list_available_monitors( &self, ) -> Result<VecDeque<Arc<dyn BackendMonitor>>, RequestError>
fn primary_monitor(&self) -> Result<Arc<dyn BackendMonitor>, RequestError>
Source§impl Clone for AutoBackend
impl Clone for AutoBackend
Source§fn clone(&self) -> AutoBackend
fn clone(&self) -> AutoBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AutoBackend
impl !RefUnwindSafe for AutoBackend
impl Send for AutoBackend
impl Sync for AutoBackend
impl Unpin for AutoBackend
impl UnsafeUnpin for AutoBackend
impl !UnwindSafe for AutoBackend
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.