Struct ToolbarLocation
pub struct ToolbarLocation {Show 15 fields
pub label: String,
pub shorter: Vec<String>,
pub value: String,
pub placeholder: String,
pub icon: Option<String>,
pub editable: bool,
pub name: String,
pub go_name: String,
pub segments: Vec<LocationSegment>,
pub image: Option<ToolbarImage>,
pub suggestions: Vec<LocationSuggestion>,
pub choices: Vec<LocationChoice>,
pub anchor: Option<String>,
pub edited: bool,
pub view_only: bool,
}Expand description
Where the window is and can go.
Fields§
§label: StringWhat the bar shows at rest: a page’s domain, a folder, a document.
shorter: Vec<String>Narrower forms of the label, widest first, each saying the same (a
period’s Jun 29 – Jul 5 for Mon, Jun 29 – Sun, Jul 5): where the
label does not fit, the bar shows the widest of them that fits the
room the location has once everything else it can fold is in the
menu, and keeps that room for it, so a wider window never shows a
narrower form. Only the last is ever elided.
value: StringWhat an edit starts from: the whole address. Empty means the label.
placeholder: StringThe field’s hint while it is empty (“Search or enter address”).
icon: Option<String>The location’s own icon, by its icon-set name (a lock for a secure page); the bar shows the app’s icon when there is none.
editable: boolA click or Ctrl+L turns it into a field.
name: StringThe field’s accessible name (“Address and search”).
go_name: StringThe go button’s name (“Go”).
segments: Vec<LocationSegment>The location’s levels, outermost first, for a breadcrumb in place of the label (a folder’s path). Empty: the label.
image: Option<ToolbarImage>The location’s own picture (a page’s favicon), shown at the bar’s leading edge instead of the app’s icon.
suggestions: Vec<LocationSuggestion>What the bar lists under the field while it is edited, best first:
the app’s answer to the text it heard last (ToolbarEvent::Edit).
choices: Vec<LocationChoice>The places the location can be switched to, for a location that is
one of a few (where a terminal’s shell runs): the label reads as a
picker and a click opens the menu of them. Choosing one commits its
value (ToolbarEvent::Commit). Empty: no picker. Not for an
editable location, which edits instead.
anchor: Option<String>Where in the app the window is, as the app’s open action takes it
(a search entry’s anchor): the desktop reopens it there, from the
launcher’s Continue. None: the app cannot be opened at it.
edited: boolThe document the location names has changes not yet saved: the bar says so after the label, in words, and tells assistive technology the same. Every editor marks its unsaved document this one way.
view_only: boolThe person may only look at what the location names: the bar says
“View only” after the label, in place of Self::edited, and tells
assistive technology the same. Set by the window’s framework from
what the person may do there (show_view_only), not by the app.
Implementations§
§impl ToolbarLocation
impl ToolbarLocation
pub fn period(period: Period) -> ToolbarLocation
pub fn period(period: Period) -> ToolbarLocation
A location naming period (crate::format::Period), in its
widest form, with its narrower ones for a narrow bar.
pub fn form(&self, form: usize) -> &str
pub fn form(&self, form: usize) -> &str
The label (0) or its narrower form form, the narrowest past the
last.
pub fn edit_value(&self) -> &str
pub fn edit_value(&self) -> &str
The text an edit starts from.
Trait Implementations§
§impl Clone for ToolbarLocation
impl Clone for ToolbarLocation
§fn clone(&self) -> ToolbarLocation
fn clone(&self) -> ToolbarLocation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ToolbarLocation
impl Debug for ToolbarLocation
§impl Default for ToolbarLocation
impl Default for ToolbarLocation
§fn default() -> ToolbarLocation
fn default() -> ToolbarLocation
§impl<'de> Deserialize<'de> for ToolbarLocation
impl<'de> Deserialize<'de> for ToolbarLocation
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolbarLocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolbarLocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for ToolbarLocation
impl PartialEq for ToolbarLocation
§impl Serialize for ToolbarLocation
impl Serialize for ToolbarLocation
§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,
impl Eq for ToolbarLocation
impl StructuralPartialEq for ToolbarLocation
Auto Trait Implementations§
impl Freeze for ToolbarLocation
impl RefUnwindSafe for ToolbarLocation
impl Send for ToolbarLocation
impl Sync for ToolbarLocation
impl Unpin for ToolbarLocation
impl UnsafeUnpin for ToolbarLocation
impl UnwindSafe for ToolbarLocation
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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