pub struct WindowMap { /* private fields */ }Expand description
Bidirectional window ID <-> iced window::Id mapping with per-window state. All mutations keep both maps in sync; callers cannot accidentally desync the forward and reverse maps.
Implementations§
Source§impl WindowMap
impl WindowMap
pub fn new() -> Self
Sourcepub fn insert(&mut self, window_id: String, iced_id: Id)
pub fn insert(&mut self, window_id: String, iced_id: Id)
Insert a new window mapping. If the window_id already exists, the old iced_id is removed from the reverse map to prevent dangling entries.
pub fn remove_by_iced(&mut self, iced_id: &Id) -> Option<String>
pub fn remove_by_window(&mut self, window_id: &str) -> Option<Id>
pub fn contains_window(&self, window_id: &str) -> bool
pub fn get_iced(&self, window_id: &str) -> Option<&Id>
Sourcepub fn get_window_id(&self, iced_id: &Id) -> Option<&str>
pub fn get_window_id(&self, iced_id: &Id) -> Option<&str>
Borrow the host-facing window ID for an iced window. Returns
None when the iced ID isn’t tracked (e.g. late events after
the window has closed).
pub fn iced_ids(&self) -> impl Iterator<Item = &Id>
pub fn window_ids(&self) -> impl Iterator<Item = &String>
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = (&String, &Id)>
pub fn clear(&mut self)
pub fn is_decorated(&self, window_id: &str) -> bool
pub fn set_decorated(&mut self, window_id: &str, decorated: bool)
pub fn cached_theme(&self, window_id: &str) -> Option<&Theme>
pub fn theme_follows_system(&self, window_id: &str) -> bool
pub fn any_theme_follows_system(&self) -> bool
pub fn cached_theme_chrome(&self, window_id: &str) -> Option<ThemeChrome>
pub fn set_theme(&mut self, window_id: &str, theme: Theme, chrome: ThemeChrome)
pub fn set_theme_follows_system(&mut self, window_id: &str)
pub fn clear_theme_cache(&mut self)
pub fn scale_factor(&self, window_id: &str) -> Option<f32>
pub fn set_scale_factor(&mut self, window_id: &str, scale_factor: Option<f32>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowMap
impl RefUnwindSafe for WindowMap
impl Send for WindowMap
impl Sync for WindowMap
impl Unpin for WindowMap
impl UnsafeUnpin for WindowMap
impl UnwindSafe for WindowMap
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> 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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Turns some type into the initial state of some
Application.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more