Struct RusticRepo

Source
pub struct RusticRepo<P>(pub Repository<P, ()>);

Tuple Fields§

§0: Repository<P, ()>

Implementations§

Methods from Deref<Target = Repository<P, ()>>§

Source

pub fn password(&self) -> Result<Option<String>, Box<RusticError>>

Evaluates the password given by the repository options

§Errors
  • If opening the password file failed
  • If reading the password failed
  • If splitting the password command failed
  • If parsing the password command failed
  • If reading the password from the command failed
§Returns

The password or None if no password is given

Source

pub fn config_id(&self) -> Result<Option<ConfigId>, Box<RusticError>>

Returns the Id of the config file

§Errors
  • If listing the repository config file failed
  • If there is more than one repository config file
§Returns

The id of the config file or None if no config file is found

Source

pub fn list<T>(&self) -> Result<impl Iterator<Item = T>, Box<RusticError>>
where T: RepoId,

List all file [Id]s of the given FileType which are present in the repository

§Arguments
  • tpe - The type of the files to list
§Errors
Source

pub fn infos_files(&self) -> Result<RepoFileInfos, Box<RusticError>>

Collect information about repository files

§Errors
  • If files could not be listed.
Source

pub fn warm_up( &self, packs: impl ExactSizeIterator<Item = PackId>, ) -> Result<(), Box<RusticError>>

Warm up the given pack files without waiting.

§Arguments
  • packs - The pack files to warm up
§Errors
  • If the command could not be parsed.
  • If the thread pool could not be created.
§Returns

The result of the warm up

Source

pub fn warm_up_wait( &self, packs: impl ExactSizeIterator<Item = PackId>, ) -> Result<(), Box<RusticError>>

Warm up the given pack files and wait the configured waiting time.

§Arguments
  • packs - The pack files to warm up
§Errors
  • If the command could not be parsed.
  • If the thread pool could not be created.
Source

pub fn cat_file( &self, tpe: FileType, id: &str, ) -> Result<Bytes, Box<RusticError>>

Get the content of the decrypted repository file given by id and FileType

§Arguments
  • tpe - The type of the file to get
  • id - The id of the file to get
§Errors
  • If the string is not a valid hexadecimal string
  • If no id could be found.
  • If the id is not unique.
Source

pub fn add_key( &self, pass: &str, opts: &KeyOptions, ) -> Result<KeyId, Box<RusticError>>

Add a new key to the repository

§Arguments
  • pass - The password to use for the new key
  • opts - The options to use for the new key
§Errors
  • If the key could not be serialized.
Source

pub fn apply_config( &self, opts: &ConfigOptions, ) -> Result<bool, Box<RusticError>>

Update the repository config by applying the given ConfigOptions

§Arguments
  • opts - The options to apply
§Errors
  • If the version is not supported
  • If the version is lower than the current version
  • If compression is set for a v1 repo
  • If the compression level is not supported
  • If the size is too large
  • If the min pack size tolerance percent is wrong
  • If the max pack size tolerance percent is wrong
  • If the file could not be serialized to json.
Source

pub fn config(&self) -> &ConfigFile

Get the repository configuration

Source

pub fn get_snapshot_group( &self, ids: &[String], group_by: SnapshotGroupCriterion, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<Vec<(SnapshotGroup, Vec<SnapshotFile>)>, Box<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 by
  • filter - 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.

Source

pub fn get_snapshot_from_str( &self, id: &str, filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync, ) -> Result<SnapshotFile, Box<RusticError>>

Get a single snapshot

§Arguments
  • id - The id of the snapshot to get
  • filter - The filter to use
§Errors
  • If the string is not a valid hexadecimal string
  • If no id could be found.
  • 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.

Source

pub fn get_snapshots<T>( &self, ids: &[T], ) -> Result<Vec<SnapshotFile>, Box<RusticError>>
where T: AsRef<str>,

Get the given snapshots.

§Arguments
  • ids - The ids of the snapshots to get
§Notes

ids may contain part of snapshots id which will be resolved. However, “latest” is not supported in this function.

§Errors
Source

pub fn update_snapshots<T>( &self, current: Vec<SnapshotFile>, ids: &[T], ) -> Result<Vec<SnapshotFile>, Box<RusticError>>
where T: AsRef<str>,

Update the given snapshots.

§Arguments
  • current - The existing snapshots
  • ids - The ids of the snapshots to get
§Notes

ids may contain part of snapshots id which will be resolved. However, “latest” is not supported in this function.

§Errors
Source

pub fn get_all_snapshots(&self) -> Result<Vec<SnapshotFile>, Box<RusticError>>

Get all snapshots from the repository

§Errors
Source

pub fn update_all_snapshots( &self, current: Vec<SnapshotFile>, ) -> Result<Vec<SnapshotFile>, Box<RusticError>>

Update existing snapshots to all from the repository

§Arguments
  • current - The existing snapshots
§Errors
Source

pub fn get_matching_snapshots( &self, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<Vec<SnapshotFile>, Box<RusticError>>

Get all snapshots from the repository respecting the given filter

§Arguments
  • filter - The filter to use
§Errors
§Note

The result is not sorted and may come in random order!

Source

pub fn update_matching_snapshots( &self, current: Vec<SnapshotFile>, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<Vec<SnapshotFile>, Box<RusticError>>

Update existing snapshots to all from the repository respecting the given filter

§Arguments
  • current - The existing snapshots
  • filter - The filter to use
§Errors
§Note

The result is not sorted and may come in random order!

Source

pub fn get_forget_snapshots( &self, keep: &KeepOptions, group_by: SnapshotGroupCriterion, filter: impl FnMut(&SnapshotFile) -> bool, ) -> Result<ForgetGroups, Box<RusticError>>

Get snapshots to forget depending on the given KeepOptions

§Arguments
  • keep - The keep options to use
  • group_by - The criterion to group by
  • filter - The filter to use
§Errors
  • If keep options are not valid
§Returns

The groups of snapshots to forget

Source

pub fn relevant_copy_snapshots( &self, filter: impl FnMut(&SnapshotFile) -> bool, snaps: &[SnapshotFile], ) -> Result<Vec<CopySnapshot>, Box<RusticError>>

Get snapshots which are not already present and should be present.

§Arguments
  • filter - The filter to use
  • snaps - The snapshots to check
§Errors
§Note

This method should be called on the destination repository

Source

pub fn delete_snapshots( &self, ids: &[SnapshotId], ) -> Result<(), Box<RusticError>>

Remove the given snapshots from the repository

§Arguments
  • ids - The ids of the snapshots to remove
§Errors
§Panics
  • If the files could not be deleted.
Source

pub fn save_snapshots( &self, snaps: Vec<SnapshotFile>, ) -> Result<(), Box<RusticError>>

Save the given snapshots to the repository.

§Arguments
  • snaps - The snapshots to save
§Errors
  • If the file could not be serialized to json.
Source

pub fn check(&self, opts: CheckOptions) -> Result<(), Box<RusticError>>

Check the repository and all snapshot trees for errors or inconsistencies

§Arguments
  • opts - The options to use
§Errors
§Panics
Source

pub fn check_with_trees( &self, opts: CheckOptions, trees: Vec<TreeId>, ) -> Result<(), Box<RusticError>>

Check the repository and given trees for errors or inconsistencies

§Arguments
  • opts - The options to use
§Errors
§Panics
Source

pub fn prune_plan( &self, opts: &PruneOptions, ) -> Result<PrunePlan, Box<RusticError>>

Get the plan about what should be pruned and/or repacked.

§Arguments
  • opts - The options to use
§Errors
§Returns

The plan about what should be pruned and/or repacked.

Source

pub fn prune( &self, opts: &PruneOptions, prune_plan: PrunePlan, ) -> Result<(), Box<RusticError>>

Perform the pruning on the repository.

§Arguments
  • opts - The options for the pruning
  • prune_plan - The plan about what should be pruned and/or repacked
§Errors
  • If the repository is in append-only mode
  • If a pack has no decision
§Returns
  • Ok(()) - If the pruning was successful
§Panics
Source

pub fn infos_index(&self) -> Result<IndexInfos, Box<RusticError>>

Get statistical information from the index. This method reads all index files, even if an index is already available in memory.

§Errors
  • If the index could not be read.
§Returns

The statistical information from the index.

Source

pub fn stream_files<F>( &self, ) -> Result<impl Iterator<Item = Result<(<F as RepoFile>::Id, F), Box<RusticError>>>, Box<RusticError>>
where F: RepoFile,

Read all files of a given RepoFile

§Errors
§Returns

An iterator over all files of the given type

§Note

The result is not sorted and may come in random order!

Source

pub fn repair_index( &self, opts: &RepairIndexOptions, dry_run: bool, ) -> Result<(), Box<RusticError>>

Repair the index

This compares the index with existing pack files and reads packfile headers to ensure the index correctly represents the pack files.

§Arguments
  • opts - The options to use
  • dry_run - If true, only print what would be done
§Errors
Source

pub fn get_index_entry<T>(&self, id: &T) -> Result<IndexEntry, Box<RusticError>>
where T: PackedId,

Get the IndexEntry of the given blob

§Arguments
  • tpe - The type of the blob
  • id - The id of the blob
§Errors
  • If the id is not found in the index
Source

pub fn open_file(&self, node: &Node) -> Result<OpenFile, Box<RusticError>>

Open a file in the repository for reading

§Arguments
  • node - The node to open
§Errors
Source

pub fn read_file_at( &self, open_file: &OpenFile, offset: usize, length: usize, ) -> Result<Bytes, Box<RusticError>>

Reads an opened file at the given position

§Arguments
  • open_file - The opened file
  • offset - The offset to start reading
  • length - The length to read
§Returns

The read bytes from the given offset and length. If offset is behind the end of the file, an empty Bytes is returned. If length is too large, the result up to the end of the file is returned.

§Errors
Source

pub fn get_tree(&self, id: &TreeId) -> Result<Tree, Box<RusticError>>

Get a Tree by [Id] from the repository.

§Arguments
  • id - The Id of the tree
§Errors
  • If the tree ID is not found in the backend.
  • If deserialization fails.
§Returns

The tree with the given Id

Source

pub fn node_from_path( &self, root_tree: TreeId, path: &Path, ) -> Result<Node, Box<RusticError>>

Get a Node from a root tree and a path

This traverses into the path to get the node.

§Arguments
  • root_tree - The TreeId of the root tree
  • path - The path
§Errors
  • If the path is not a directory.
  • If the path is not found.
  • If the path is not UTF-8 conform.
Source

pub fn find_nodes_from_path( &self, ids: impl IntoIterator<Item = TreeId>, path: &Path, ) -> Result<FindNode, Box<RusticError>>

Get all Nodes from given root trees and a path

§Arguments
  • ids - The tree ids to search in
  • path - The path
§Errors
  • If loading trees from the backend fails
Source

pub fn find_matching_nodes( &self, ids: impl IntoIterator<Item = TreeId>, matches: &impl Fn(&Path, &Node) -> bool, ) -> Result<FindMatches, Box<RusticError>>

Get all Nodes/Paths from given root trees and a matching criterion

§Arguments
  • ids - The tree ids to search in
  • matches - The matching criterion
§Errors
  • If loading trees from the backend fails
Source

pub fn node_from_snapshot_path( &self, snap_path: &str, filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync, ) -> Result<Node, Box<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 snapshot
  • filter - The filter to use
§Errors
  • If the string is not a valid hexadecimal string
  • If no id could be found.
  • If the id is not unique.
Source

pub fn node_from_snapshot_and_path( &self, snap: &SnapshotFile, path: &str, ) -> Result<Node, Box<RusticError>>

Get a Node from a SnapshotFile and a path

This traverses into the path to get the node.

§Arguments
  • snap - The snapshot to use
  • path - The path to the node
§Errors
Source

pub fn cat_tree( &self, snap: &str, sn_filter: impl FnMut(&SnapshotFile) -> bool + Send + Sync, ) -> Result<Bytes, Box<RusticError>>

Reads a raw tree from a “SNAP[:PATH]” syntax

This parses a snapshot (using the filter when “latest” is used) and then traverses into the path to get the tree.

§Arguments
  • snap - The snapshot to use
  • sn_filter - The filter to use
§Errors
Source

pub fn ls( &self, node: &Node, ls_opts: &TreeStreamerOptions, ) -> Result<impl Iterator<Item = Result<(PathBuf, Node), Box<RusticError>>> + Clone, Box<RusticError>>

List the contents of a given Node

§Arguments
  • node - The node to list
  • ls_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
Source

pub fn restore( &self, restore_infos: RestorePlan, opts: &RestoreOptions, node_streamer: impl Iterator<Item = Result<(PathBuf, Node), Box<RusticError>>>, dest: &LocalDestination, ) -> Result<(), Box<RusticError>>

Restore a given RestorePlan to a local destination

§Arguments
  • restore_infos - The restore plan to use
  • opts - The options to use
  • node_streamer - The node streamer to use
  • dest - The destination to use
§Errors
Source

pub fn merge_trees( &self, trees: &[TreeId], cmp: &impl Fn(&Node, &Node) -> Ordering, summary: &mut SnapshotSummary, ) -> Result<TreeId, Box<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 merge
  • cmp - The comparison function to use for merge conflicts
  • summary - The summary to use
§Errors
§Returns

This method returns the blob [Id] of the merged tree.

Source

pub fn merge_snapshots( &self, snaps: &[SnapshotFile], cmp: &impl Fn(&Node, &Node) -> Ordering, snap: SnapshotFile, ) -> Result<SnapshotFile, Box<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 merge
  • cmp - The comparison function to use for merge conflicts
  • snap - The snapshot to save
§Errors
§Returns

This method returns the modified and already saved SnapshotFile.

Source

pub fn backup( &self, opts: &BackupOptions, source: &PathList, snap: SnapshotFile, ) -> Result<SnapshotFile, Box<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 use
  • source - The source to backup
  • snap - The snapshot to modify and save
§Errors
§Returns

The saved snapshot.

Source

pub fn get_blob_cached( &self, id: &BlobId, tpe: BlobType, ) -> Result<Bytes, Box<RusticError>>

Get a blob utilizing the internal blob cache

§Arguments
  • id - The id of the blob
  • tpe - The type of the blob
§Errors
  • If the blob is not found in the index
§Returns

The cached blob in bytes.

Source

pub fn cat_blob( &self, tpe: BlobType, id: &str, ) -> Result<Bytes, Box<RusticError>>

Read a raw blob

§Arguments
  • tpe - The type of the blob
  • id - The id of the blob
§Errors
  • If the string is not a valid hexadecimal string
§Returns

The raw blob in bytes.

Source

pub fn dump( &self, node: &Node, w: &mut impl Write, ) -> Result<(), Box<RusticError>>

Dump a Node using the given writer.

§Arguments
  • node - The node to dump
  • w - The writer to use
§Errors
  • If the node is not a file.
§Note

Currently, only regular file nodes are supported.

Source

pub fn prepare_restore( &self, opts: &RestoreOptions, node_streamer: impl Iterator<Item = Result<(PathBuf, Node), Box<RusticError>>>, dest: &LocalDestination, dry_run: bool, ) -> Result<RestorePlan, Box<RusticError>>

Prepare the restore.

If dry_run is set to false, it will also:

  • remove existing files from the destination, if opts.delete is set to true
  • create all dirs for the restore
§Arguments
  • opts - The options to use
  • node_streamer - The node streamer to use
  • dest - The destination to use
  • dry_run - If true, only print what would be done
§Errors
  • If a directory could not be created.
  • If the restore information could not be collected.
§Returns

The restore plan.

Source

pub fn copy<'a, Q, R>( &self, repo_dest: &Repository<Q, R>, snapshots: impl IntoIterator<Item = &'a SnapshotFile>, ) -> Result<(), Box<RusticError>>
where Q: ProgressBars, R: IndexedIds,

Copy the given snapshots to repo_dest.

§Type Parameters
  • Q - The type of the progress bar
  • R - The type of the index.
§Arguments
  • repo_dest - The destination repository
  • snapshots - 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.

Source

pub fn repair_snapshots( &self, opts: &RepairSnapshotsOptions, snapshots: Vec<SnapshotFile>, dry_run: bool, ) -> Result<(), Box<RusticError>>

Repair snapshots.

This traverses all trees of all snapshots and repairs defect trees.

§Arguments
  • opts - The options to use
  • snapshots - The snapshots to repair
  • dry_run - If true, only print what would be done
§Warning
  • If you remove the original snapshots, you may loose data!
§Errors

Trait Implementations§

Source§

impl<P: Debug> Debug for RusticRepo<P>

Source§

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

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

impl<P> Deref for RusticRepo<P>

Source§

type Target = Repository<P, ()>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

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

Borrow this concrete type as a &dyn Any
Source§

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

Borrow this concrete type as a &mut dyn Any
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> 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<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSend for T
where T: Send,