pub struct PackageData {
pub migrations: BTreeMap<String, ModuleMigrations>,
pub migration_connection: String,
pub migrations_of_all: BTreeSet<String>,
pub migration_table: Option<bool>,
pub translations: Option<LangReport>,
}Expand description
What the package said about an app, from the reads the user started.
It lives in memory only: the database changes outside Mortise.
Fields§
§migrations: BTreeMap<String, ModuleMigrations>The migration state, by module name, of Self::migration_connection.
migration_connection: StringThe connection the migration state was read for (--database). Empty for
the default connection.
migrations_of_all: BTreeSet<String>The modules that were on at the last read of every module (--all), while
that read holds: nothing was forgotten after it. Such a module with no entry
was not in its answer. Empty without such a read.
migration_table: Option<bool>Whether the database has a migrations table, from the last state read.
translations: Option<LangReport>The last translation report, by module.
Implementations§
Source§impl PackageData
impl PackageData
Sourcepub fn migrations_for(
&self,
connection: &str,
) -> Option<&BTreeMap<String, ModuleMigrations>>
pub fn migrations_for( &self, connection: &str, ) -> Option<&BTreeMap<String, ModuleMigrations>>
The migration state when it was read for connection (empty for the default).
A state of another connection says nothing about this one.
Sourcepub fn migrations_of_every(&self, connection: &str, modules_on: &[&str]) -> bool
pub fn migrations_of_every(&self, connection: &str, modules_on: &[&str]) -> bool
True when the state on connection says something of every module in modules_on:
each has an entry, or was on at a read of every module that holds since (design D7).
A count over the modules that are on is then whole.
Sourcepub fn forget_migrations(&mut self, target: &Target) -> bool
pub fn forget_migrations(&mut self, target: &Target) -> bool
Forgets the migration state of target, whatever connection it was read for:
every module for Target::All, else the module’s entry, by name in any case.
A “no migrations table” answer goes too: the run may have made the table.
A read of every module no longer covers them all. True when something was forgotten.
Sourcepub fn merge_migrations(
&mut self,
status: MigrationStatus,
target: &Target,
connection: &str,
modules_on: &[&str],
read_ms: i64,
)
pub fn merge_migrations( &mut self, status: MigrationStatus, target: &Target, connection: &str, modules_on: &[&str], read_ms: i64, )
Takes in a state read of target on connection, read at read_ms. A read of
another connection than the state’s replaces the whole state. A module of the
document replaces its entry. Under --all, a module in modules_on that the
document does not hold is removed, because the package lists every module that is on.
Sourcepub fn merge_translations(&mut self, report: LangReport)
pub fn merge_translations(&mut self, report: LangReport)
Takes in a translation report. A module of the report replaces its entry, so a check of one module keeps the others.
Trait Implementations§
Source§impl Clone for PackageData
impl Clone for PackageData
Source§impl Debug for PackageData
impl Debug for PackageData
Source§impl Default for PackageData
impl Default for PackageData
Source§impl<'de> Deserialize<'de> for PackageData
impl<'de> Deserialize<'de> for PackageData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PackageData
Source§impl PartialEq for PackageData
impl PartialEq for PackageData
Source§impl Serialize for PackageData
impl Serialize for PackageData
impl StructuralPartialEq for PackageData
Auto Trait Implementations§
impl Forget for PackageData
impl Freeze for PackageData
impl Move for PackageData
impl RefUnwindSafe for PackageData
impl Send for PackageData
impl Sync for PackageData
impl Unpin for PackageData
impl UnsafeUnpin for PackageData
impl UnwindSafe for PackageData
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);