pub struct RowField {
pub meta: Meta,
pub key: String,
pub kind: FieldKind,
pub choices: Vec<RowChoice>,
pub choices_key: Option<String>,
pub command: String,
pub args: Value,
}Expand description
An editable cell: a record’s value shown as a field (a toggle, a
text, a choice) and written through a command whose arguments name
the record (${row.<key>}) and the new value (${value}). In a
table it takes the place of the column of its key, or adds one; in a
list it shows under the record’s title. Its when and enabled
read the record as row.<key>; its description is its tooltip.
Fields§
§meta: Meta§key: StringThe record’s key it shows.
kind: FieldKindtoggle, text or choice; another kind shows as text.
choices: Vec<RowChoice>§choices_key: Option<String>The choices from the record: an array of {value, label} at this
key (destinations that depend on the record).
command: String§args: ValueImplementations§
Source§impl RowField
impl RowField
Sourcepub fn toggle(key: &str, title: &str, command: &str, args: Value) -> RowField
pub fn toggle(key: &str, title: &str, command: &str, args: Value) -> RowField
A switch over a boolean.
Sourcepub fn text(key: &str, title: &str, command: &str, args: Value) -> RowField
pub fn text(key: &str, title: &str, command: &str, args: Value) -> RowField
A text, written when the field is left or Enter is pressed.
Sourcepub fn choice(
key: &str,
title: &str,
choices: &[(Value, &str)],
command: &str,
args: Value,
) -> RowField
pub fn choice( key: &str, title: &str, choices: &[(Value, &str)], command: &str, args: Value, ) -> RowField
One of the choices (value, label).
Sourcepub fn choices_from(self, key: &str) -> RowField
pub fn choices_from(self, key: &str) -> RowField
The choices read from the record at key.
Sourcepub fn choices_of(&self, row: &Value) -> Vec<RowChoice>
pub fn choices_of(&self, row: &Value) -> Vec<RowChoice>
The choices offered for a record: the declared ones, then those the record holds.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RowField
impl<'de> Deserialize<'de> for RowField
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RowField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RowField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for RowField
impl Serialize for RowField
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,
impl StructuralPartialEq for RowField
Auto Trait Implementations§
impl Freeze for RowField
impl RefUnwindSafe for RowField
impl Send for RowField
impl Sync for RowField
impl Unpin for RowField
impl UnsafeUnpin for RowField
impl UnwindSafe for RowField
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