#[non_exhaustive]pub struct PanelOpenAsk {
pub panel: String,
pub place: OpenPlace,
pub group: Option<String>,
pub instance: Option<String>,
pub owner: String,
pub origin: Option<String>,
}Expand description
A panel asked open: which panel, where, and who asks.
use egui_pop_api::bus::{OpenPlace, PanelOpenAsk};
let ask = PanelOpenAsk::new("app.outline", OpenPlace::Here, "app").group("app.inspector");
let json = serde_json::to_value(&ask).unwrap();
assert_eq!(json["place"], "here");
assert_eq!(json["group"], "app.inspector");Need (layout): open a closed panel again where it was, or in a given tab group.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.panel: StringThe panel’s id.
place: OpenPlaceWhere it opens; last when not given.
group: Option<String>For OpenPlace::Here: a panel of the tab group it joins; the
focused panel’s group when not given.
instance: Option<String>For a panel declared with several: "new" opens a new instance,
an instance’s id (<panel>#<n>) that one; the panel itself when
not given.
owner: StringWho asks: a plugin’s id, a menu’s, an agent’s.
origin: Option<String>The application window it is asked from, by id (main for the
main window): where it opens when its last place is in no window
shown (rule A). Menus, commands and keys fill it in with the
window they run in when not given.
Implementations§
Source§impl PanelOpenAsk
impl PanelOpenAsk
pub fn new( panel: impl Into<String>, place: OpenPlace, owner: impl Into<String>, ) -> Self
Sourcepub fn instance(self, instance: impl Into<String>) -> Self
pub fn instance(self, instance: impl Into<String>) -> Self
Which instance opens: "new", or an instance’s id.
Sourcepub fn group(self, panel: impl Into<String>) -> Self
pub fn group(self, panel: impl Into<String>) -> Self
The tab group it joins, by one of its panels (OpenPlace::Here).
Trait Implementations§
Source§impl Clone for PanelOpenAsk
impl Clone for PanelOpenAsk
Source§fn clone(&self) -> PanelOpenAsk
fn clone(&self) -> PanelOpenAsk
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PanelOpenAsk
impl Debug for PanelOpenAsk
Source§impl<'de> Deserialize<'de> for PanelOpenAsk
impl<'de> Deserialize<'de> for PanelOpenAsk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PanelOpenAsk
impl PartialEq for PanelOpenAsk
Source§impl Serialize for PanelOpenAsk
impl Serialize for PanelOpenAsk
impl StructuralPartialEq for PanelOpenAsk
Auto Trait Implementations§
impl Freeze for PanelOpenAsk
impl RefUnwindSafe for PanelOpenAsk
impl Send for PanelOpenAsk
impl Sync for PanelOpenAsk
impl Unpin for PanelOpenAsk
impl UnsafeUnpin for PanelOpenAsk
impl UnwindSafe for PanelOpenAsk
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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