Skip to main content

ReadingRow

Struct ReadingRow 

Source
pub struct ReadingRow {
    pub id: String,
    pub title: String,
    pub subtitle: Option<String>,
    pub group: Option<String>,
    pub icon: Option<String>,
    pub facts: Vec<String>,
    pub fields: Vec<String>,
    pub action: Option<String>,
    pub arguments: BTreeMap<String, Value>,
    pub app: Option<String>,
}
Expand description

One item a reading lists among its values — a container, a drive and its partitions, a printer and its jobs, a process, a journal record — as a person finds it in search: what it is called, what says what it is, and how choosing it opens it.

A reading publishes these for every list its resource keeps (Service::search_rows); the system’s search lists each as a row of its own, so a device reading’s items are found the way an app’s are, without the app that shows them having to run.

Fields§

§id: String

The item’s stable id in its reading: a container’s name, a drive’s name in /dev, a journal record’s moment.

§title: String

What the row says.

§subtitle: Option<String>

The line under it (a publisher, a state, a unit).

§group: Option<String>

The group it is listed under (“Containers”, “Printers”).

§icon: Option<String>

A named icon (a lucide kebab name).

§facts: Vec<String>

Where it is (a container’s image, a drive’s mount point): further lines, not matched.

§fields: Vec<String>

More text it is found by: a publisher, a command, a record’s unit.

§action: Option<String>

The action of its resource that opens it on the item, when the reading offers one: a program’s launch, a partition’s mount.

§arguments: BTreeMap<String, Value>

The values that action takes to name the item, by parameter name.

§app: Option<String>

The app whose window shows the item, opened when the reading offers no action on it.

Implementations§

Source§

impl ReadingRow

Source

pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self

The item id, called title.

Source

pub fn subtitled(self, subtitle: impl Into<String>) -> Self

The line under it.

Source

pub fn grouped(self, group: impl Into<String>) -> Self

The group it is listed under.

Source

pub fn icon(self, icon: impl Into<String>) -> Self

A named icon.

Source

pub fn fact(self, fact: impl Into<String>) -> Self

Where it is.

Source

pub fn field(self, field: impl Into<String>) -> Self

More text it is found by.

Source

pub fn opened_by<K, V>( self, action: impl Into<String>, arguments: impl IntoIterator<Item = (K, V)>, ) -> Self
where K: Into<String>, V: Into<Value>,

The action of its resource that opens it, given the item by arguments.

Source

pub fn shown_by(self, app: impl Into<String>) -> Self

The app whose window shows it.

Trait Implementations§

Source§

impl Clone for ReadingRow

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReadingRow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReadingRow

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ReadingRow

Source§

impl PartialEq for ReadingRow

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReadingRow

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more