pub struct RusticRepo<P>(pub Repository<P, ()>);Tuple Fields§
§0: Repository<P, ()>Implementations§
source§impl<P: Clone + ProgressBars> RusticRepo<P>
impl<P: Clone + ProgressBars> RusticRepo<P>
pub fn open(self) -> Result<Repository<P, OpenStatus>>
fn open_or_init_repository_with( self, do_init: bool, init: impl FnOnce(Self) -> Result<Repository<P, OpenStatus>>, ) -> Result<Repository<P, OpenStatus>>
fn indexed(self) -> Result<Repository<P, IndexedStatus<FullIndex, OpenStatus>>>
Methods from Deref<Target = Repository<P, ()>>§
sourcepub fn password(&self) -> Result<Option<String>, RusticError>
pub fn password(&self) -> Result<Option<String>, RusticError>
Evaluates the password given by the repository options
§Errors
RepositoryErrorKind::OpeningPasswordFileFailed- If opening the password file failedRepositoryErrorKind::ReadingPasswordFromReaderFailed- If reading the password failedRepositoryErrorKind::FromSplitError- If splitting the password command failedRepositoryErrorKind::PasswordCommandExecutionFailed- If parsing the password command failedRepositoryErrorKind::ReadingPasswordFromCommandFailed- If reading the password from the command failed
§Returns
The password or None if no password is given
sourcepub fn config_id(&self) -> Result<Option<ConfigId>, RusticError>
pub fn config_id(&self) -> Result<Option<ConfigId>, RusticError>
Returns the Id of the config file
§Errors
RepositoryErrorKind::ListingRepositoryConfigFileFailed- If listing the repository config file failedRepositoryErrorKind::MoreThanOneRepositoryConfig- If there is more than one repository config file
§Returns
The id of the config file or None if no config file is found
sourcepub fn infos_files(&self) -> Result<RepoFileInfos, RusticError>
pub fn infos_files(&self) -> Result<RepoFileInfos, RusticError>
sourcepub fn warm_up(
&self,
packs: impl ExactSizeIterator<Item = PackId>,
) -> Result<(), RusticError>
pub fn warm_up( &self, packs: impl ExactSizeIterator<Item = PackId>, ) -> Result<(), RusticError>
Warm up the given pack files without waiting.
§Arguments
packs- The pack files to warm up
§Errors
- [
RepositoryErrorKind::FromSplitError] - If the command could not be parsed. RepositoryErrorKind::FromThreadPoolbilderError- If the thread pool could not be created.
§Returns
The result of the warm up
sourcepub fn warm_up_wait(
&self,
packs: impl ExactSizeIterator<Item = PackId>,
) -> Result<(), RusticError>
pub fn warm_up_wait( &self, packs: impl ExactSizeIterator<Item = PackId>, ) -> Result<(), RusticError>
Warm up the given pack files and wait the configured waiting time.
§Arguments
packs- The pack files to warm up
§Errors
RepositoryErrorKind::FromSplitError- If the command could not be parsed.RepositoryErrorKind::FromThreadPoolbilderError- If the thread pool could not be created.
sourcepub fn cat_file(&self, tpe: FileType, id: &str) -> Result<Bytes, RusticError>
pub fn cat_file(&self, tpe: FileType, id: &str) -> Result<Bytes, RusticError>
Get the content of the decrypted repository file given by id and FileType
§Arguments
tpe- The type of the file to getid- The id of the file to get
§Errors
IdErrorKind::HexError- If the string is not a valid hexadecimal stringBackendAccessErrorKind::NoSuitableIdFound- If no id could be found.BackendAccessErrorKind::IdNotUnique- If the id is not unique.
sourcepub fn add_key(
&self,
pass: &str,
opts: &KeyOptions,
) -> Result<KeyId, RusticError>
pub fn add_key( &self, pass: &str, opts: &KeyOptions, ) -> Result<KeyId, RusticError>
Add a new key to the repository
§Arguments
pass- The password to use for the new keyopts- The options to use for the new key
§Errors
CommandErrorKind::FromJsonError- If the key could not be serialized.
sourcepub fn apply_config(&self, opts: &ConfigOptions) -> Result<bool, RusticError>
pub fn apply_config(&self, opts: &ConfigOptions) -> Result<bool, RusticError>
Update the repository config by applying the given ConfigOptions
§Arguments
opts- The options to apply
§Errors
CommandErrorKind::VersionNotSupported- If the version is not supportedCommandErrorKind::CannotDowngrade- If the version is lower than the current versionCommandErrorKind::NoCompressionV1Repo- If compression is set for a v1 repoCommandErrorKind::CompressionLevelNotSupported- If the compression level is not supportedCommandErrorKind::SizeTooLarge- If the size is too largeCommandErrorKind::MinPackSizeTolerateWrong- If the min packsize tolerance percent is wrongCommandErrorKind::MaxPackSizeTolerateWrong- If the max packsize tolerance percent is wrongCryptBackendErrorKind::SerializingToJsonByteVectorFailed- If the file could not be serialized to json.
sourcepub fn config(&self) -> &ConfigFile
pub fn config(&self) -> &ConfigFile
Get the repository configuration
sourcepub fn get_snapshot_group(
&self,
ids: &[String],
group_by: SnapshotGroupCriterion,
filter: impl FnMut(&SnapshotFile) -> bool,
) -> Result<Vec<(SnapshotGroup, Vec<SnapshotFile>)>, RusticError>
pub fn get_snapshot_group( &self, ids: &[String], group_by: SnapshotGroupCriterion, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<Vec<(SnapshotGroup, Vec<SnapshotFile>)>, RusticError>
Get grouped snapshots.
§Arguments
ids- The ids of the snapshots to group. If empty, all snapshots are grouped.group_by- The criterion to group byfilter- The filter to use
§Errors
§Returns
If ids are given, this will try to resolve the ids (or latest with respect to the given filter) and return a single group
If ids is empty, return and group all snapshots respecting the filter.
sourcepub fn get_snapshot_from_str(
&self,
id: &str,
filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync,
) -> Result<SnapshotFile, RusticError>
pub fn get_snapshot_from_str( &self, id: &str, filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync, ) -> Result<SnapshotFile, RusticError>
Get a single snapshot
§Arguments
id- The id of the snapshot to getfilter- The filter to use
§Errors
IdErrorKind::HexError- If the string is not a valid hexadecimal stringBackendAccessErrorKind::NoSuitableIdFound- If no id could be found.BackendAccessErrorKind::IdNotUnique- If the id is not unique.
§Returns
If id is (part of) an Id, return this snapshot.
If id is “latest”, return the latest snapshot respecting the giving filter.
sourcepub fn get_snapshots<T>(
&self,
ids: &[T],
) -> Result<Vec<SnapshotFile>, RusticError>
pub fn get_snapshots<T>( &self, ids: &[T], ) -> Result<Vec<SnapshotFile>, RusticError>
sourcepub fn update_snapshots<T>(
&self,
current: Vec<SnapshotFile>,
ids: &[T],
) -> Result<Vec<SnapshotFile>, RusticError>
pub fn update_snapshots<T>( &self, current: Vec<SnapshotFile>, ids: &[T], ) -> Result<Vec<SnapshotFile>, RusticError>
sourcepub fn get_all_snapshots(&self) -> Result<Vec<SnapshotFile>, RusticError>
pub fn get_all_snapshots(&self) -> Result<Vec<SnapshotFile>, RusticError>
Get all snapshots from the repository
§Errors
sourcepub fn update_all_snapshots(
&self,
current: Vec<SnapshotFile>,
) -> Result<Vec<SnapshotFile>, RusticError>
pub fn update_all_snapshots( &self, current: Vec<SnapshotFile>, ) -> Result<Vec<SnapshotFile>, RusticError>
sourcepub fn get_matching_snapshots(
&self,
filter: impl FnMut(&SnapshotFile) -> bool,
) -> Result<Vec<SnapshotFile>, RusticError>
pub fn get_matching_snapshots( &self, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<Vec<SnapshotFile>, RusticError>
sourcepub fn update_matching_snapshots(
&self,
current: Vec<SnapshotFile>,
filter: impl FnMut(&SnapshotFile) -> bool,
) -> Result<Vec<SnapshotFile>, RusticError>
pub fn update_matching_snapshots( &self, current: Vec<SnapshotFile>, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<Vec<SnapshotFile>, RusticError>
sourcepub fn get_forget_snapshots(
&self,
keep: &KeepOptions,
group_by: SnapshotGroupCriterion,
filter: impl FnMut(&SnapshotFile) -> bool,
) -> Result<ForgetGroups, RusticError>
pub fn get_forget_snapshots( &self, keep: &KeepOptions, group_by: SnapshotGroupCriterion, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<ForgetGroups, RusticError>
Get snapshots to forget depending on the given KeepOptions
§Arguments
keep- The keep options to usegroup_by- The criterion to group byfilter- The filter to use
§Errors
If keep options are not valid
§Returns
The groups of snapshots to forget
sourcepub fn relevant_copy_snapshots(
&self,
filter: impl FnMut(&SnapshotFile) -> bool,
snaps: &[SnapshotFile],
) -> Result<Vec<CopySnapshot>, RusticError>
pub fn relevant_copy_snapshots( &self, filter: impl FnMut(&SnapshotFile) -> bool, snaps: &[SnapshotFile], ) -> Result<Vec<CopySnapshot>, RusticError>
sourcepub fn delete_snapshots(&self, ids: &[SnapshotId]) -> Result<(), RusticError>
pub fn delete_snapshots(&self, ids: &[SnapshotId]) -> Result<(), RusticError>
sourcepub fn save_snapshots(
&self,
snaps: Vec<SnapshotFile>,
) -> Result<(), RusticError>
pub fn save_snapshots( &self, snaps: Vec<SnapshotFile>, ) -> Result<(), RusticError>
Save the given snapshots to the repository.
§Arguments
snaps- The snapshots to save
§Errors
CryptBackendErrorKind::SerializingToJsonByteVectorFailed- If the file could not be serialized to json.
sourcepub fn check(&self, opts: CheckOptions) -> Result<(), RusticError>
pub fn check(&self, opts: CheckOptions) -> Result<(), RusticError>
sourcepub fn check_with_trees(
&self,
opts: CheckOptions,
trees: Vec<TreeId>,
) -> Result<(), RusticError>
pub fn check_with_trees( &self, opts: CheckOptions, trees: Vec<TreeId>, ) -> Result<(), RusticError>
sourcepub fn prune_plan(&self, opts: &PruneOptions) -> Result<PrunePlan, RusticError>
pub fn prune_plan(&self, opts: &PruneOptions) -> Result<PrunePlan, RusticError>
sourcepub fn prune(
&self,
opts: &PruneOptions,
prune_plan: PrunePlan,
) -> Result<(), RusticError>
pub fn prune( &self, opts: &PruneOptions, prune_plan: PrunePlan, ) -> Result<(), RusticError>
Perform the pruning on the repository.
§Arguments
opts- The options for the pruningprune_plan- The plan about what should be pruned and/or repacked
§Errors
CommandErrorKind::NotAllowedWithAppendOnly- If the repository is in append-only modeCommandErrorKind::NoDecision- If a pack has no decision
§Returns
Ok(())- If the pruning was successful
§Panics
sourcepub fn infos_index(&self) -> Result<IndexInfos, RusticError>
pub fn infos_index(&self) -> Result<IndexInfos, RusticError>
sourcepub fn stream_files<F>(
&self,
) -> Result<impl Iterator<Item = Result<(<F as RepoFile>::Id, F), RusticError>>, RusticError>where
F: RepoFile,
pub fn stream_files<F>(
&self,
) -> Result<impl Iterator<Item = Result<(<F as RepoFile>::Id, F), RusticError>>, RusticError>where
F: RepoFile,
sourcepub fn repair_index(
&self,
opts: &RepairIndexOptions,
dry_run: bool,
) -> Result<(), RusticError>
pub fn repair_index( &self, opts: &RepairIndexOptions, dry_run: bool, ) -> Result<(), RusticError>
sourcepub fn get_index_entry<T>(&self, id: &T) -> Result<IndexEntry, RusticError>where
T: PackedId,
pub fn get_index_entry<T>(&self, id: &T) -> Result<IndexEntry, RusticError>where
T: PackedId,
Get the IndexEntry of the given blob
§Arguments
tpe- The type of the blobid- The id of the blob
§Errors
RepositoryErrorKind::IdNotFound- If the id is not found in the index
sourcepub fn read_file_at(
&self,
open_file: &OpenFile,
offset: usize,
length: usize,
) -> Result<Bytes, RusticError>
pub fn read_file_at( &self, open_file: &OpenFile, offset: usize, length: usize, ) -> Result<Bytes, RusticError>
sourcepub fn get_tree(&self, id: &TreeId) -> Result<Tree, RusticError>
pub fn get_tree(&self, id: &TreeId) -> Result<Tree, RusticError>
Get a Tree by [Id] from the repository.
§Arguments
id- TheIdof the tree
§Errors
TreeErrorKind::BlobIdNotFound- If the tree ID is not found in the backend.TreeErrorKind::DeserializingTreeFailed- If deserialization fails.
§Returns
The tree with the given Id
sourcepub fn node_from_path(
&self,
root_tree: TreeId,
path: &Path,
) -> Result<Node, RusticError>
pub fn node_from_path( &self, root_tree: TreeId, path: &Path, ) -> Result<Node, RusticError>
Get a Node from a root tree and a path
This traverses into the path to get the node.
§Arguments
root_tree- TheIdof the root treepath- The path
§Errors
TreeErrorKind::NotADirectory- If the path is not a directory.TreeErrorKind::PathNotFound- If the path is not found.TreeErrorKind::PathIsNotUtf8Conform- If the path is not UTF-8 conform.
sourcepub fn find_nodes_from_path(
&self,
ids: impl IntoIterator<Item = TreeId>,
path: &Path,
) -> Result<FindNode, RusticError>
pub fn find_nodes_from_path( &self, ids: impl IntoIterator<Item = TreeId>, path: &Path, ) -> Result<FindNode, RusticError>
sourcepub fn find_matching_nodes(
&self,
ids: impl IntoIterator<Item = TreeId>,
matches: &impl Fn(&Path, &Node) -> bool,
) -> Result<FindMatches, RusticError>
pub fn find_matching_nodes( &self, ids: impl IntoIterator<Item = TreeId>, matches: &impl Fn(&Path, &Node) -> bool, ) -> Result<FindMatches, RusticError>
sourcepub fn node_from_snapshot_path(
&self,
snap_path: &str,
filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync,
) -> Result<Node, RusticError>
pub fn node_from_snapshot_path( &self, snap_path: &str, filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync, ) -> Result<Node, RusticError>
Get a Node from a “SNAP[:PATH]” syntax
This parses for a snapshot (using the filter when “latest” is used) and then traverses into the path to get the node.
§Arguments
snap_path- The path to the snapshotfilter- The filter to use
§Errors
IdErrorKind::HexError- If the string is not a valid hexadecimal stringBackendAccessErrorKind::NoSuitableIdFound- If no id could be found.BackendAccessErrorKind::IdNotUnique- If the id is not unique.
sourcepub fn node_from_snapshot_and_path(
&self,
snap: &SnapshotFile,
path: &str,
) -> Result<Node, RusticError>
pub fn node_from_snapshot_and_path( &self, snap: &SnapshotFile, path: &str, ) -> Result<Node, RusticError>
Get a Node from a SnapshotFile and a path
This traverses into the path to get the node.
§Arguments
snap- The snapshot to usepath- The path to the node
§Errors
sourcepub fn cat_tree(
&self,
snap: &str,
sn_filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync,
) -> Result<Bytes, RusticError>
pub fn cat_tree( &self, snap: &str, sn_filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync, ) -> Result<Bytes, RusticError>
sourcepub fn ls(
&self,
node: &Node,
ls_opts: &TreeStreamerOptions,
) -> Result<impl Iterator<Item = Result<(PathBuf, Node), RusticError>> + Clone, RusticError>
pub fn ls( &self, node: &Node, ls_opts: &TreeStreamerOptions, ) -> Result<impl Iterator<Item = Result<(PathBuf, Node), RusticError>> + Clone, RusticError>
List the contents of a given Node
§Arguments
node- The node to listls_opts- The options to use
§Returns
If node is a tree node, this will list the content of that tree.
If node is a file node, this will only return one element.
§Note
The PathBuf returned will be relative to the given node.
§Errors
sourcepub fn restore(
&self,
restore_infos: RestorePlan,
opts: &RestoreOptions,
node_streamer: impl Iterator<Item = Result<(PathBuf, Node), RusticError>>,
dest: &LocalDestination,
) -> Result<(), RusticError>
pub fn restore( &self, restore_infos: RestorePlan, opts: &RestoreOptions, node_streamer: impl Iterator<Item = Result<(PathBuf, Node), RusticError>>, dest: &LocalDestination, ) -> Result<(), RusticError>
Restore a given RestorePlan to a local destination
§Arguments
restore_infos- The restore plan to useopts- The options to usenode_streamer- The node streamer to usedest- The destination to use
§Errors
sourcepub fn merge_trees(
&self,
trees: &[TreeId],
cmp: &impl Fn(&Node, &Node) -> Ordering,
summary: &mut SnapshotSummary,
) -> Result<TreeId, RusticError>
pub fn merge_trees( &self, trees: &[TreeId], cmp: &impl Fn(&Node, &Node) -> Ordering, summary: &mut SnapshotSummary, ) -> Result<TreeId, RusticError>
Merge the given trees.
This method creates needed tree blobs within the repository.
Merge conflicts (identical filenames which do not match) will be resolved using the ordering given by cmp.
§Arguments
trees- The trees to mergecmp- The comparison function to use for merge conflictssummary- The summary to use
§Errors
§Returns
This method returns the blob [Id] of the merged tree.
sourcepub fn merge_snapshots(
&self,
snaps: &[SnapshotFile],
cmp: &impl Fn(&Node, &Node) -> Ordering,
snap: SnapshotFile,
) -> Result<SnapshotFile, RusticError>
pub fn merge_snapshots( &self, snaps: &[SnapshotFile], cmp: &impl Fn(&Node, &Node) -> Ordering, snap: SnapshotFile, ) -> Result<SnapshotFile, RusticError>
Merge the given snapshots.
This method will create needed tree blobs within the repository.
Merge conflicts (identical filenames which do not match) will be resolved using the ordering given by cmp.
§Arguments
snaps- The snapshots to mergecmp- The comparison function to use for merge conflictssnap- The snapshot to save
§Errors
§Returns
This method returns the modified and already saved SnapshotFile.
sourcepub fn backup(
&self,
opts: &BackupOptions,
source: &PathList,
snap: SnapshotFile,
) -> Result<SnapshotFile, RusticError>
pub fn backup( &self, opts: &BackupOptions, source: &PathList, snap: SnapshotFile, ) -> Result<SnapshotFile, RusticError>
Run a backup of source using the given options.
You have to give a preflled SnapshotFile which is modified and saved.
§Arguments
opts- The options to usesource- The source to backupsnap- The snapshot to modify and save
§Errors
§Returns
The saved snapshot.
sourcepub fn get_blob_cached(
&self,
id: &BlobId,
tpe: BlobType,
) -> Result<Bytes, RusticError>
pub fn get_blob_cached( &self, id: &BlobId, tpe: BlobType, ) -> Result<Bytes, RusticError>
Get a blob utilizing the internal blob cache
§Arguments
id- The id of the blobtpe- The type of the blob
§Errors
IndexErrorKind::BlobInIndexNotFound- If the blob is not found in the index
§Returns
The cached blob in bytes.
sourcepub fn cat_blob(&self, tpe: BlobType, id: &str) -> Result<Bytes, RusticError>
pub fn cat_blob(&self, tpe: BlobType, id: &str) -> Result<Bytes, RusticError>
Read a raw blob
§Arguments
tpe- The type of the blobid- The id of the blob
§Errors
IdErrorKind::HexError- If the string is not a valid hexadecimal string
§Returns
The raw blob in bytes.
sourcepub fn dump(&self, node: &Node, w: &mut impl Write) -> Result<(), RusticError>
pub fn dump(&self, node: &Node, w: &mut impl Write) -> Result<(), RusticError>
Dump a Node using the given writer.
§Arguments
node- The node to dumpw- The writer to use
§Note
Currently, only regular file nodes are supported.
§Errors
CommandErrorKind::DumpNotSupported- If the node is not a file.
sourcepub fn prepare_restore(
&self,
opts: &RestoreOptions,
node_streamer: impl Iterator<Item = Result<(PathBuf, Node), RusticError>>,
dest: &LocalDestination,
dry_run: bool,
) -> Result<RestorePlan, RusticError>
pub fn prepare_restore( &self, opts: &RestoreOptions, node_streamer: impl Iterator<Item = Result<(PathBuf, Node), RusticError>>, dest: &LocalDestination, dry_run: bool, ) -> Result<RestorePlan, RusticError>
Prepare the restore.
If dry_run is set to false, it will also:
- remove existing files from the destination, if
opts.deleteis set to true - create all dirs for the restore
§Arguments
opts- The options to usenode_streamer- The node streamer to usedest- The destination to usedry_run- If true, only print what would be done
§Errors
CommandErrorKind::ErrorCreating- If a directory could not be created.CommandErrorKind::ErrorCollecting- If the restore information could not be collected.
§Returns
The restore plan.
sourcepub fn copy<'a, Q, R>(
&self,
repo_dest: &Repository<Q, R>,
snapshots: impl IntoIterator<Item = &'a SnapshotFile>,
) -> Result<(), RusticError>where
Q: ProgressBars,
R: IndexedIds,
pub fn copy<'a, Q, R>(
&self,
repo_dest: &Repository<Q, R>,
snapshots: impl IntoIterator<Item = &'a SnapshotFile>,
) -> Result<(), RusticError>where
Q: ProgressBars,
R: IndexedIds,
Copy the given snapshots to repo_dest.
§Type Parameters
Q- The type of the progress barR- The type of the index.
§Arguments
repo_dest- The destination repositorysnapshots- The snapshots to copy
§Errors
§Note
This command copies snapshots even if they already exist. For already existing snapshots, a copy will be created in the destination repository.
To omit already existing snapshots, use relevant_copy_snapshots and filter out the non-relevant ones.
sourcepub fn repair_snapshots(
&self,
opts: &RepairSnapshotsOptions,
snapshots: Vec<SnapshotFile>,
dry_run: bool,
) -> Result<(), RusticError>
pub fn repair_snapshots( &self, opts: &RepairSnapshotsOptions, snapshots: Vec<SnapshotFile>, dry_run: bool, ) -> Result<(), RusticError>
Trait Implementations§
source§impl<P: Debug> Debug for RusticRepo<P>
impl<P: Debug> Debug for RusticRepo<P>
Auto Trait Implementations§
impl<P> Freeze for RusticRepo<P>where
P: Freeze,
impl<P> !RefUnwindSafe for RusticRepo<P>
impl<P> Send for RusticRepo<P>where
P: Send,
impl<P> Sync for RusticRepo<P>where
P: Sync,
impl<P> Unpin for RusticRepo<P>where
P: Unpin,
impl<P> !UnwindSafe for RusticRepo<P>
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> 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<D> OwoColorize for D
impl<D> OwoColorize for D
source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
source§fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
source§fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
source§fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
source§fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
source§fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
source§fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
source§fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
source§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
source§fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
source§fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
source§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
source§fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
source§fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
source§fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
source§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
source§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
source§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
source§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
source§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
source§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
source§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
source§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
source§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
source§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
source§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
source§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
source§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
source§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
source§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
source§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
source§fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
source§fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
source§fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
source§fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
source§fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
source§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
source§fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
source§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moresource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more