Struct WidgetPrefs
pub struct WidgetPrefs {
pub enabled: bool,
pub show: ShowMode,
pub always_on_strips: Vec<u64>,
pub places: Vec<Place>,
pub width: Option<f64>,
}Expand description
One widget’s choices.
Fields§
§enabled: boolWhether the person keeps this widget on their desk.
show: ShowModeWhen the widget shows itself.
always_on_strips: Vec<u64>The strips (by id) ShowMode::Always applies to; empty is every
strip.
places: Vec<Place>Where it rests on each display it was dropped on, the display it was last dropped on first: it lives there while that display is connected, and on the next connected one in this list (or the primary display, at its own default place) while it is not.
width: Option<f64>Its open card’s width, in logical pixels, after the person resized it; unset is the widget’s own default. Each widget keeps it within its own narrowest and widest, all inside this range.
Implementations§
§impl WidgetPrefs
impl WidgetPrefs
pub fn serialize<__S>(
__self: &WidgetPrefs,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl<'de> WidgetPrefs
impl<'de> WidgetPrefs
pub fn deserialize<__D>(
__deserializer: __D,
) -> Result<WidgetPrefs, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl WidgetPrefs
impl WidgetPrefs
pub fn default_for(id: WidgetId) -> WidgetPrefs
pub fn default_for(id: WidgetId) -> WidgetPrefs
A widget nobody has configured yet.
pub fn place_on<'a>(&'a self, connected: &[&str]) -> Option<&'a Place>
pub fn place_on<'a>(&'a self, connected: &[&str]) -> Option<&'a Place>
Where it rests on the first of connected displays it has a place
on, in the order it was dropped there (most recent first): that
display’s identity and the place’s fractions.
pub fn drop_on(&mut self, display: &str, x: f64, y: f64)
pub fn drop_on(&mut self, display: &str, x: f64, y: f64)
Dropped at x, y on display: that display becomes the one it
lives on, and its place there is this one.
pub fn always_on(&self, strip: Option<u64>) -> bool
pub fn always_on(&self, strip: Option<u64>) -> bool
Whether ShowMode::Always holds on strip.
Trait Implementations§
§impl Clone for WidgetPrefs
impl Clone for WidgetPrefs
§fn clone(&self) -> WidgetPrefs
fn clone(&self) -> WidgetPrefs
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 WidgetPrefs
impl Debug for WidgetPrefs
§impl<'de> Deserialize<'de> for WidgetPrefs
impl<'de> Deserialize<'de> for WidgetPrefs
§fn deserialize<D>(
deserializer: D,
) -> Result<WidgetPrefs, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<WidgetPrefs, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl PartialEq for WidgetPrefs
impl PartialEq for WidgetPrefs
§impl Serialize for WidgetPrefs
impl Serialize for WidgetPrefs
§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 StructuralPartialEq for WidgetPrefs
Auto Trait Implementations§
impl Freeze for WidgetPrefs
impl RefUnwindSafe for WidgetPrefs
impl Send for WidgetPrefs
impl Sync for WidgetPrefs
impl Unpin for WidgetPrefs
impl UnsafeUnpin for WidgetPrefs
impl UnwindSafe for WidgetPrefs
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<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