pub struct FrameSpec {Show 16 fields
pub id: FrameId,
pub kind: Kind,
pub group: Option<GroupId>,
pub title: String,
pub icon: Option<String>,
pub transient: bool,
pub visible: bool,
pub tone: Option<String>,
pub keys: Vec<(String, String)>,
pub arrangement: Option<String>,
pub show: Vec<PanelId>,
pub hide: Vec<PanelId>,
pub can_enter: Option<Arc<dyn Fn(&GuardCall<'_>) -> Verdict + Sync + Send>>,
pub can_leave: Option<Arc<dyn Fn(&GuardCall<'_>) -> Verdict + Sync + Send>>,
pub label: Option<Arc<dyn Fn(&LabelCall<'_>) -> Option<String> + Sync + Send>>,
pub arrangement_for: Option<Arc<dyn Fn(&Value) -> Option<String> + Sync + Send>>,
}Expand description
A frame as declared.
Fields§
§id: FrameId§kind: Kind§group: Option<GroupId>A mode’s group (one mode of a group at a time); none for a place.
title: StringFor the breadcrumb and the mode chips, in English; the interface
translates it through the key derived from the id,
frame-<id>.title (egui_pop_core::strings::frame_title).
icon: Option<String>An icon’s name, for the chips and crumbs (egui_pop_core::icon).
transient: boolOn the live stack, never restored.
visible: boolA mode: its group shows in the status bar, as a chip while one of its modes is on. A group is shown when any of its modes says so; a group that is pure plumbing stays out of the bar.
tone: Option<String>A mode: its chip’s tone, by the kit’s tone name (accent, info,
success, warning, danger, muted, record); accent when
none.
keys: Vec<(String, String)>Context keys the frame sets while it is on (the top place’s, every active mode’s).
arrangement: Option<String>The arrangement (a template or a saved name) the frame’s projection starts from the first time, until the user picks another there: a place’s, or a mode’s, which wins over the place’s while it is on.
show: Vec<PanelId>A mode: panels it shows while on.
hide: Vec<PanelId>A mode: panels it hides while on.
can_enter: Option<Arc<dyn Fn(&GuardCall<'_>) -> Verdict + Sync + Send>>§can_leave: Option<Arc<dyn Fn(&GuardCall<'_>) -> Verdict + Sync + Send>>§label: Option<Arc<dyn Fn(&LabelCall<'_>) -> Option<String> + Sync + Send>>A place: its crumb’s label from its payload.
arrangement_for: Option<Arc<dyn Fn(&Value) -> Option<String> + Sync + Send>>A place: the arrangement it starts from, from its payload.
Implementations§
Source§impl FrameSpec
impl FrameSpec
pub fn icon(self, icon: &str) -> FrameSpec
Sourcepub fn visible(self) -> FrameSpec
pub fn visible(self) -> FrameSpec
A mode: shows its group in the status bar (a chip while one of its modes is on).
Sourcepub fn tone(self, tone: &str) -> FrameSpec
pub fn tone(self, tone: &str) -> FrameSpec
A mode: its chip’s tone, a kit tone name (record for “an agent
is driving”).
Sourcepub fn arrangement(self, name: &str) -> FrameSpec
pub fn arrangement(self, name: &str) -> FrameSpec
The arrangement the frame’s projection starts from (a place’s, or a mode’s, which wins over the place’s while it is on).
Sourcepub fn can_enter(
self,
f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static,
) -> FrameSpec
pub fn can_enter( self, f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static, ) -> FrameSpec
Whether the frame may be entered.
Sourcepub fn can_leave(
self,
f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static,
) -> FrameSpec
pub fn can_leave( self, f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static, ) -> FrameSpec
Whether the frame may be left.
Sourcepub fn label(
self,
f: impl Fn(&LabelCall<'_>) -> Option<String> + Send + Sync + 'static,
) -> FrameSpec
pub fn label( self, f: impl Fn(&LabelCall<'_>) -> Option<String> + Send + Sync + 'static, ) -> FrameSpec
A place: its crumb’s label from its payload (a sub-workspace’s
name for {"id": "…"}), wherever the interface says the crumb
(the breadcrumb, context.read, an announcement, an undo toast).
None keeps the default: the title, and the payload when it is a
text or a number. Called while the interface draws: it must not
call back into the context stack.
Sourcepub fn arrangement_for(
self,
f: impl Fn(&Value) -> Option<String> + Send + Sync + 'static,
) -> FrameSpec
pub fn arrangement_for( self, f: impl Fn(&Value) -> Option<String> + Send + Sync + 'static, ) -> FrameSpec
A place: the arrangement (a template or a saved name) an entry
starts from, chosen from its payload; None falls back to
arrangement. Read the first time a
projection key is shown: the layout it was left with wins on
later entries.
Sourcepub fn label_of(&self, title: &str, payload: &Value) -> Option<String>
pub fn label_of(&self, title: &str, payload: &Value) -> Option<String>
The crumb label label gives for a payload, if
any.
Sourcepub fn arrangement_of(&self, payload: &Value) -> Option<String>
pub fn arrangement_of(&self, payload: &Value) -> Option<String>
The arrangement arrangement_for chooses
for a payload, if any.
Trait Implementations§
Source§impl Serialize for FrameSpec
impl Serialize for FrameSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for FrameSpec
impl !RefUnwindSafe for FrameSpec
impl Send for FrameSpec
impl Sync for FrameSpec
impl Unpin for FrameSpec
impl UnsafeUnpin for FrameSpec
impl !UnwindSafe for FrameSpec
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