pub struct PanelId(/* private fields */);Expand description
A panel: app.log; an instance of a panel declared with several
(PanelSpec::instances) adds #<n>: app.gallery#2.
Implementations§
Source§impl PanelId
impl PanelId
Source§impl PanelId
impl PanelId
Sourcepub fn kind(&self) -> PanelId
pub fn kind(&self) -> PanelId
The panel declared this id is an instance of: itself for the
panel declared (instance 1), app.gallery for app.gallery#2.
use egui_pop_model::ids::PanelId;
let second = PanelId::new("app.gallery#2").unwrap();
assert_eq!(second.kind().as_str(), "app.gallery");
assert_eq!(second.instance_number(), 2);
assert_eq!(second.kind().instance_number(), 1);
assert_eq!(second.kind().instance(2).unwrap(), second);
assert!(PanelId::new("app.gallery#1").is_err());
assert!(PanelId::new("app.gallery#02").is_err());Sourcepub fn instance_number(&self) -> u32
pub fn instance_number(&self) -> u32
Its instance’s number: 1 for the panel declared.
Sourcepub fn is_instance(&self) -> bool
pub fn is_instance(&self) -> bool
Whether it names an instance other than the panel declared
(#<n>).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PanelId
impl<'de> Deserialize<'de> for PanelId
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for PanelId
impl Ord for PanelId
Source§impl PartialOrd for PanelId
impl PartialOrd for PanelId
impl Eq for PanelId
impl StructuralPartialEq for PanelId
Auto Trait Implementations§
impl Freeze for PanelId
impl RefUnwindSafe for PanelId
impl Send for PanelId
impl Sync for PanelId
impl Unpin for PanelId
impl UnsafeUnpin for PanelId
impl UnwindSafe for PanelId
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