Skip to main content

Attention

Struct Attention 

Source
pub struct Attention {
    cells: [[Level; 9]; 36],
    sources: BTreeMap<String, [Level; 9]>,
    names: BTreeMap<String, String>,
}
Expand description

The matrix: a level in each cell, as set; and the sources’ own rows, an app’s or a conversation’s on a phone, by id (app.<package>, conversation.<key>), each with its name when written with one.

Fields§

§cells: [[Level; 9]; 36]§sources: BTreeMap<String, [Level; 9]>§names: BTreeMap<String, String>

Implementations§

Source§

impl Attention

Source

pub fn usual() -> Attention

What Sioul does unless you change it (usual).

Source

pub fn of(config: &Config) -> Attention

As the configuration says: the usual cells; while no [attention] is written, what the older keys changed (seeded); then each row’s words. A fixed cell, a value not offered there and a word not understood are left aside; of two words for one column, the later counts.

Source

pub fn cell(&self, row: Row, column: Column) -> Level

Source

pub fn set( &mut self, row: Row, column: Column, level: Level, ) -> Result<(), String>

A cell changed; refused when it is fixed, or when the value is not one it may take (choices).

Source

pub fn words(&self, row: Row) -> Vec<String>

A row as the configuration writes it, whole: “work” for at once, “sleep:later” for another value.

Source

pub fn changes_from(&self, other: &Attention) -> usize

How many cells differ from another matrix’s (a preset’s); the sources’ own rows aside, which no preset sets.

Source

pub fn source(&self, id: &str) -> Option<[Level; 9]>

A source’s own row (app.<package>, conversation.<key>): its nine cells; none while every one says as usual.

Source

pub fn sources(&self) -> &BTreeMap<String, [Level; 9]>

The sources’ rows set, by id.

Source

pub fn source_name(&self, id: &str) -> &str

The name a source’s row was written with (an app’s, for your other devices, which never saw it); “” when none.

Source

pub fn set_source( &mut self, id: &str, column: Column, level: Level, ) -> Result<(), String>

A source’s cell changed; refused when the id names no source, or the value is not one a source’s cell takes (SOURCE_CHOICES). A row as usual everywhere is no row: taken out.

Source

pub fn name_source(&mut self, id: &str, name: &str)

A source’s name, kept beside its row (“” takes it out).

Source

pub fn source_words(&self, id: &str) -> Vec<String>

A source’s row as the configuration writes it: its cells set (“work” for at once, “admin:later”), as usual unsaid, then its name (“name=Discord”); nothing when as usual everywhere.

Source

pub fn has_sources(&self, ids: &[String]) -> bool

Whether one of these sources has a row set: a notification from them reads it.

Source

fn source_cells(&self, ids: &[String]) -> Vec<[Level; 9]>

The rows set among these sources, the most precise first.

Source

fn base_at(&self, base: Base, column: Column, now: &Now) -> Level

What a row, or a person on a channel, gives at one column, as level and person read it (= and ☆ resolved, “Nothing at all” holding the states’ rows in Free time): what a source’s “as usual” stands for.

Source

fn over(&self, base: Base, sources: &[[Level; 9]], now: &Now) -> (Level, bool)

A row, or a person, read with sources’ rows over it (sources, the most precise first: a conversation’s, then its app’s): at each column the first cell set, else the row’s own (base_at); then as level reads a moment, the least strict of the times, the stricter of that and each layer that holds. With it, whether a source’s cell said any of the columns read now.

Source

fn lent(&self, row: Row, column: Column, week: Week) -> Level

A row’s cell at a time column, lent as the week says for the people’s rows: while admin has no hours of its own, work time takes admin’s cell too; while work has none, admin time takes work’s (areas::in_view).

Source

pub fn level(&self, row: Row, now: &Now) -> Level

A row now: the least strict of the time’s columns, then the stricter of that and each layer that holds. A state’s row waits in a Free time of “Nothing at all”. Always through’s own values read here as what the row alone lets through (= waits, ☆ comes); person reads them against a person’s own row.

Source

pub fn person( &self, channel: Channel, person: Person, always: bool, now: &Now, ) -> Level

Someone on a channel now: the blocked never (blocked beats Always through); on the Always through list, that row, its = read as their own row, its ☆ as a layer that does not hold them; else their own row.

Source

pub fn listed(&self, person: Person, always: bool, now: &Now) -> bool

A call after the fact (declined, on the Porch’s list; a missed call’s notification): when its caller’s Calls row lets them through now (docs/attention.md, Q23); a row that rings at no time at all (strangers, as usual) in work and admin time, the Porch’s own hours, so that no call is never listed. The blocked never.

Source

fn meets( &self, channel: Channel, person: Person, area: Area, week: Week, ) -> bool

Whether a person’s row lets them through at some time of the week that an area is for: when none, the area holds nothing back for good.

Source§

impl Attention

Source

pub fn decide(&self, event: &Event, now: &Now) -> Output

What comes of an event now, step by step (docs/attention.md, §2): the blocked first, then the content, the floors, the exceptions, the matrix, what the source is for, the named holds. Which device tells it and how stays the caller’s (§8).

Source

pub fn mail( &self, t: &Triaged, senders: &Senders, always: &People, area: Area, now: &Now, ) -> Output

A message as the Porch judged it, now: its sender’s row as the Porch weighs it (set aside or unproven, a stranger’s), Always through when the list holds its proven address, what the address it came to is for. Shown says whether the Porch shows it now, told whether new mail’s notification may name it (its lane aside: mailnote::never).

Source

fn own(&self, kind: Kind, event: &Event, now: &Now) -> Output

Source

fn letter( &self, who: Who, always: bool, lane: Lane, event: &Event, now: &Now, ) -> Output

Source

fn call( &self, who: Option<Who>, always: bool, emergency: bool, repeat: bool, now: &Now, ) -> Output

Source

fn message( &self, via: Channel, who: Who, group: bool, always: bool, event: &Event, now: &Now, ) -> Output

Source

fn site( &self, call: bool, live: bool, named: Option<Who>, event: &Event, now: &Now, ) -> Output

Source§

impl Attention

Source

pub fn silence_at(&self, now: &Now, phone: Phone) -> Silence

What a mode lets through at a moment (Now): as level reads it, the times together the least strict, a layer (do-not-disturb over the time now) the stricter, “Nothing at all” holding the states’ rows. Calls: where this phone screens them, every contact’s, Sioul having declined the others already; else the starred, Android’s nearest to Always through; anyone’s while “Let every call through” holds (Now::through), so that the mode lets ring what the screening lets through. Messages: the starred when the matrix lets anyone write then, never wider, though Sioul may hold other apps’ notifications: Android sounds a notification before any listener hears of it (docs/android.md, “Sound”), so a contact’s message let through the mode, then held by Sioul, would ring once; the mode alone keeps a held message silent.

Source

pub fn silence( &self, columns: &[Column], nothing: bool, phone: Phone, ) -> Silence

The same for columns (the pause’s, Free time’s, sleep’s; a layer, the switch’s): the times among them together, the layers above them, as silence_at reads them, every hours set. A layer alone says what it lets through by itself.

Trait Implementations§

Source§

impl Clone for Attention

Source§

fn clone(&self) -> Attention

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 Attention

Source§

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

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

impl Default for Attention

Source§

fn default() -> Attention

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

impl Eq for Attention

Source§

impl PartialEq for Attention

Source§

fn eq(&self, other: &Attention) -> 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 Attention

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

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

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

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

§

fn vzip(self) -> V