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
impl Attention
Sourcepub fn of(config: &Config) -> Attention
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.
pub fn cell(&self, row: Row, column: Column) -> Level
Sourcepub fn set(
&mut self,
row: Row,
column: Column,
level: Level,
) -> Result<(), String>
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).
Sourcepub fn words(&self, row: Row) -> Vec<String>
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.
Sourcepub fn changes_from(&self, other: &Attention) -> usize
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.
Sourcepub fn source(&self, id: &str) -> Option<[Level; 9]>
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.
Sourcepub fn source_name(&self, id: &str) -> &str
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.
Sourcepub fn set_source(
&mut self,
id: &str,
column: Column,
level: Level,
) -> Result<(), String>
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.
Sourcepub fn name_source(&mut self, id: &str, name: &str)
pub fn name_source(&mut self, id: &str, name: &str)
A source’s name, kept beside its row (“” takes it out).
Sourcepub fn source_words(&self, id: &str) -> Vec<String>
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.
Sourcepub fn has_sources(&self, ids: &[String]) -> bool
pub fn has_sources(&self, ids: &[String]) -> bool
Whether one of these sources has a row set: a notification from them reads it.
Sourcefn source_cells(&self, ids: &[String]) -> Vec<[Level; 9]>
fn source_cells(&self, ids: &[String]) -> Vec<[Level; 9]>
The rows set among these sources, the most precise first.
Sourcefn base_at(&self, base: Base, column: Column, now: &Now) -> Level
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.
Sourcefn over(&self, base: Base, sources: &[[Level; 9]], now: &Now) -> (Level, bool)
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.
Sourcefn lent(&self, row: Row, column: Column, week: Week) -> Level
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).
Sourcepub fn level(&self, row: Row, now: &Now) -> Level
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.
Sourcepub fn person(
&self,
channel: Channel,
person: Person,
always: bool,
now: &Now,
) -> Level
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.
Sourcepub fn listed(&self, person: Person, always: bool, now: &Now) -> bool
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§impl Attention
impl Attention
Sourcepub fn decide(&self, event: &Event, now: &Now) -> Output
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).
Sourcepub fn mail(
&self,
t: &Triaged,
senders: &Senders,
always: &People,
area: Area,
now: &Now,
) -> Output
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).
fn own(&self, kind: Kind, event: &Event, now: &Now) -> Output
fn letter( &self, who: Who, always: bool, lane: Lane, event: &Event, now: &Now, ) -> Output
fn call( &self, who: Option<Who>, always: bool, emergency: bool, repeat: bool, now: &Now, ) -> Output
fn message( &self, via: Channel, who: Who, group: bool, always: bool, event: &Event, now: &Now, ) -> Output
fn site( &self, call: bool, live: bool, named: Option<Who>, event: &Event, now: &Now, ) -> Output
Source§impl Attention
impl Attention
Sourcepub fn silence_at(&self, now: &Now, phone: Phone) -> Silence
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.
Sourcepub fn silence(
&self,
columns: &[Column],
nothing: bool,
phone: Phone,
) -> Silence
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§
impl Eq for Attention
impl StructuralPartialEq for Attention
Auto Trait Implementations§
impl Freeze for Attention
impl RefUnwindSafe for Attention
impl Send for Attention
impl Sync for Attention
impl Unpin for Attention
impl UnsafeUnpin for Attention
impl UnwindSafe for Attention
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv 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
§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<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
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) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
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
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.