pub struct LogicalWindowId(/* private fields */);Expand description
Stable, provider-neutral identifier for a logical application window.
A logical window can outlive any native window or presentation surface used to display it. Hosts are responsible for rejecting duplicate identifiers when application windows are declared.
§Examples
use ailloli_ui_core::LogicalWindowId;
let id = LogicalWindowId::new("main");
assert_eq!(id.as_str(), "main");Implementations§
Source§impl LogicalWindowId
impl LogicalWindowId
Sourcepub fn new(value: impl Into<String>) -> Self
pub fn new(value: impl Into<String>) -> Self
Wraps an opaque identifier exactly as supplied.
Empty and duplicate values are representable; the application host rejects duplicates when it assembles declared windows.
§Examples
use ailloli_ui_core::LogicalWindowId;
assert_eq!(LogicalWindowId::new("main").as_str(), "main");Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Borrows the opaque identifier without allocation.
§Examples
use ailloli_ui_core::LogicalWindowId;
assert_eq!(LogicalWindowId::new("main").as_str(), "main");Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the identifier and returns its owned string.
§Examples
use ailloli_ui_core::LogicalWindowId;
assert_eq!(LogicalWindowId::new("main").into_string(), String::from("main"));Trait Implementations§
Source§impl AsRef<str> for LogicalWindowId
impl AsRef<str> for LogicalWindowId
Source§impl Clone for LogicalWindowId
impl Clone for LogicalWindowId
Source§fn clone(&self) -> LogicalWindowId
fn clone(&self) -> LogicalWindowId
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogicalWindowId
impl Debug for LogicalWindowId
Source§impl Default for LogicalWindowId
impl Default for LogicalWindowId
Source§fn default() -> LogicalWindowId
fn default() -> LogicalWindowId
Returns the “default value” for a type. Read more
Source§impl Display for LogicalWindowId
impl Display for LogicalWindowId
Source§impl From<&String> for LogicalWindowId
impl From<&String> for LogicalWindowId
Source§impl From<&str> for LogicalWindowId
impl From<&str> for LogicalWindowId
Source§impl From<String> for LogicalWindowId
impl From<String> for LogicalWindowId
Source§impl Hash for LogicalWindowId
impl Hash for LogicalWindowId
Source§impl Ord for LogicalWindowId
impl Ord for LogicalWindowId
Source§fn cmp(&self, other: &LogicalWindowId) -> Ordering
fn cmp(&self, other: &LogicalWindowId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LogicalWindowId
impl PartialEq for LogicalWindowId
Source§impl PartialOrd for LogicalWindowId
impl PartialOrd for LogicalWindowId
impl Eq for LogicalWindowId
impl StructuralPartialEq for LogicalWindowId
Auto Trait Implementations§
impl Freeze for LogicalWindowId
impl RefUnwindSafe for LogicalWindowId
impl Send for LogicalWindowId
impl Sync for LogicalWindowId
impl Unpin for LogicalWindowId
impl UnwindSafe for LogicalWindowId
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