Skip to main content

WikiCommand

Enum WikiCommand 

Source
pub enum WikiCommand {
Show 35 variants Get { page: String, }, List { page: String, cursor: Option<String>, }, Find { text: String, kind: Option<String>, page: u32, }, Comments { page: String, thread: Option<u64>, status: Option<String>, cursor: Option<String>, }, Attachments { page: String, cursor: Option<String>, }, Grids { page: String, cursor: Option<String>, }, Grid { grid: String, filter: Option<String>, sort: Option<String>, columns: Option<String>, rows: Option<String>, revision: Option<u64>, }, Resources { page: String, kind: Option<String>, query: Option<String>, cursor: Option<String>, }, Create { page: String, title: String, from: Option<String>, silent: bool, }, Update { page: String, title: Option<String>, from: Option<String>, merge: bool, silent: bool, }, Append { page: String, from: String, top: bool, anchor: Option<String>, silent: bool, }, Delete { page: String, recursive: bool, }, Restore { token: String, }, Comment { page: String, text: String, reply_to: Option<u64>, quote: Option<String>, }, DeleteComment { page: String, comment: u64, }, Access { page: String, }, Grant { page: String, role: String, user: Option<String>, uid: Option<String>, cloud_uid: Option<String>, group: Option<String>, no_inherit: bool, allow_selflock: bool, }, Regrant { page: String, access: String, role: Option<String>, inheritance: Option<String>, allow_selflock: bool, }, Revoke { page: String, access: Option<String>, all: bool, allow_selflock: bool, }, ClonePage { page: String, target: String, title: Option<String>, subscribe: bool, no_wait: bool, }, CloneGrid { grid: String, target: String, title: Option<String>, with_data: bool, no_wait: bool, }, Operation { kind: String, id: String, }, CreateGrid { page: String, title: String, }, UpdateGrid { grid: String, title: Option<String>, sort: Option<String>, revision: Option<String>, }, DeleteGrid { grid: String, }, RowsAdd { grid: String, from: String, after: Option<String>, position: Option<u64>, revision: Option<String>, }, RowsDelete { grid: String, rows: Vec<String>, revision: Option<String>, }, RowsMove { grid: String, row: String, after: Option<String>, position: Option<u64>, count: Option<u64>, revision: Option<String>, }, ColumnsAdd { grid: String, from: String, position: Option<u64>, revision: Option<String>, }, ColumnsDelete { grid: String, columns: Vec<String>, revision: Option<String>, }, ColumnsMove { grid: String, column: String, position: u64, count: Option<u64>, revision: Option<String>, }, CellsSet { grid: String, set: Vec<String>, revision: Option<String>, }, Upload { page: String, files: Vec<PathBuf>, }, DeleteAttachment { page: String, file: String, }, Download { page: String, file: Option<String>, out: PathBuf, force: bool, },
}

Variants§

§

Get

Show one page: its title and last change, then its text.

Fields

§page: String

The page’s slug, or its address as copied from the browser.

§

List

List the pages under one.

Fields

§page: String

The page’s slug, or its address.

§cursor: Option<String>

Where the previous page of this listing ended, as its tally named it.

§

Find

Search pages and files.

Fields

§text: String

Words to look for.

§kind: Option<String>

Only pages, or only attached files.

§page: u32

Which page of hits, from 1; the Wiki’s search stops at 500.

§

Comments

Show a page’s comments.

Fields

§page: String

The page’s slug, or its address.

§thread: Option<u64>

Every post in one comment’s thread, by the comment’s id.

§status: Option<String>

Only resolved, or only unresolved, comments.

§cursor: Option<String>

Where the previous page of this listing ended, as its tally named it.

§

Attachments

List a page’s attachments.

Fields

§page: String

The page’s slug, or its address.

§cursor: Option<String>

Where the previous page of this listing ended, as its tally named it.

§

Grids

List the grids — dynamic tables — on a page.

Fields

§page: String

The page’s slug, or its address.

§cursor: Option<String>

Where the previous page of this listing ended, as its tally named it.

§

Grid

Show one grid: its columns, then its rows.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§filter: Option<String>

Only matching rows, in the Wiki’s syntax: [slug] ~ text AND [n] < 3.

§sort: Option<String>

Order of the rows: slug, -other.

§columns: Option<String>

Only these columns, by slug, comma-separated.

§rows: Option<String>

Only these rows, by id, comma-separated.

§revision: Option<u64>

The grid as it was at this revision.

§

Resources

List what a page holds: files and grids together.

Fields

§page: String

The page’s slug, or its address.

§kind: Option<String>

Only files, or only grids.

§query: Option<String>

Only those whose name or title matches.

§cursor: Option<String>

Where the previous page of this listing ended, as its tally named it.

§

Create

Create a page; its parent is whatever the slug’s path says.

Fields

§page: String

Where the page goes: users/me/notes, or an address.

§title: String
§from: Option<String>

The page’s text: a file, or - for stdin.

§silent: bool

Do not notify subscribers.

§

Update

Replace a page’s text, or retitle it.

Fields

§page: String

The page’s slug, or its address.

§from: Option<String>

The page’s new text in full: a file, or - for stdin.

§merge: bool

Fold in edits made since, rather than be refused over them.

§silent: bool

Do not notify subscribers.

§

Append

Add text to a page: at the bottom, the top, or an anchor.

Fields

§page: String

The page’s slug, or its address.

§from: String

The text to add: a file, or - for stdin.

§top: bool

At the top rather than the bottom.

§anchor: Option<String>

At this anchor in the page, such as #deploy.

§silent: bool

Do not notify subscribers.

§

Delete

Delete a page, printing the token that restores it.

Fields

§page: String

The page’s slug, or its address.

§recursive: bool

Its subpages too. Needs –yes.

§

Restore

Restore a deleted page by the token its deletion printed.

Fields

§token: String
§

Comment

Comment on a page, or reply to a comment.

Fields

§page: String

The page’s slug, or its address.

§text: String

The comment; - reads it from stdin.

§reply_to: Option<u64>

Reply to this comment, by its id.

§quote: Option<String>

The passage of the page the comment is about.

§

DeleteComment

Delete a comment. There is no undo, so it needs –yes.

Fields

§page: String

The page’s slug, or its address.

§comment: u64

The comment’s id, as wiki comments shows it.

§

Access

Show who can read and edit a page.

Fields

§page: String

The page’s slug, or its address.

§

Grant

Give a user or a group a role on a page.

Fields

§page: String

The page’s slug, or its address.

§role: String

reader, editor, extra_editor (may also manage access) or author.

§user: Option<String>

A login; its uid is looked up in Tracker.

§uid: Option<String>

A user’s uid, as the organisation’s directory has it.

§cloud_uid: Option<String>

A user’s Yandex Cloud id.

§group: Option<String>

A group, as SOURCE:ID; the source is dir, cloud, com or staff.

§no_inherit: bool

Keep the role off the subpages.

§allow_selflock: bool

Allow a change that could lock you yourself out of the page.

§

Regrant

Change a grant’s role, or whether subpages inherit it.

Fields

§page: String

The page’s slug, or its address.

§access: String

The grant’s id, as wiki access lists it.

§inheritance: Option<String>
§allow_selflock: bool

Allow a change that could lock you yourself out of the page.

§

Revoke

Remove a grant, or every personal grant on a page.

Fields

§page: String

The page’s slug, or its address.

§access: Option<String>

The grant’s id, as wiki access lists it.

§all: bool

Every personal grant on the page. Needs –yes.

§allow_selflock: bool

Allow a change that could lock you yourself out of the page.

§

ClonePage

Copy a page to a new address, and wait for the copy.

Fields

§page: String

The page’s slug, or its address.

§target: String

Where the copy goes; a page there already is a refusal.

§title: Option<String>

The copy’s title, when it should not keep the original’s.

§subscribe: bool

Subscribe to the copy.

§no_wait: bool

Print the operation and return, rather than wait for the copy.

§

CloneGrid

Copy a grid onto a page, and wait for the copy.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§target: String

The page the copy goes on; created if it is not there.

§with_data: bool

Copy the rows too, not only the columns.

§no_wait: bool

Print the operation and return, rather than wait for the copy.

§

Operation

Show where a clone has got to.

Fields

§kind: String

clone for a page, clone_inline_grid for a grid.

§

CreateGrid

Create an empty grid on a page.

Fields

§page: String

The page’s slug, or its address.

§title: String
§

UpdateGrid

Retitle a grid, or set the order its rows show in.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§sort: Option<String>

Default order: slug:asc,other:desc.

§revision: Option<String>

The revision the change is made against; read first when omitted.

§

DeleteGrid

Delete a grid. There is no undo, so it needs –yes.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§

RowsAdd

Add rows from JSON: an array of objects keyed by column slug.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§from: String

The rows as JSON: a file, or - for stdin.

§after: Option<String>

Put them after this row.

§position: Option<u64>

Put them at this position, from 0.

§revision: Option<String>

The revision the change is made against; read first when omitted.

§

RowsDelete

Delete rows by id. There is no undo, so it needs –yes.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§rows: Vec<String>
§revision: Option<String>

The revision the change is made against; read first when omitted.

§

RowsMove

Move a row — and the rows after it, with –count.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§after: Option<String>

After this row.

§position: Option<u64>

To this position, from 0.

§count: Option<u64>

How many rows to move, starting with this one.

§revision: Option<String>

The revision the change is made against; read first when omitted.

§

ColumnsAdd

Add columns from JSON: an array of column definitions.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§from: String

The columns as JSON: a file, or - for stdin.

§position: Option<u64>

Put them at this position, from 0.

§revision: Option<String>

The revision the change is made against; read first when omitted.

§

ColumnsDelete

Delete columns by slug. There is no undo, so it needs –yes.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§columns: Vec<String>
§revision: Option<String>

The revision the change is made against; read first when omitted.

§

ColumnsMove

Move a column to a position.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§column: String
§position: u64

Where to, from 0.

§count: Option<u64>

How many columns to move, starting with this one.

§revision: Option<String>

The revision the change is made against; read first when omitted.

§

CellsSet

Set cells: –set ROW:SLUG=VALUE, as many as needed.

Fields

§grid: String

The grid’s id, as wiki grids lists it.

§revision: Option<String>

The revision the change is made against; read first when omitted.

§

Upload

Attach files to a page.

Fields

§page: String

The page’s slug, or its address.

§files: Vec<PathBuf>
§

DeleteAttachment

Delete a file attached to a page. There is no undo, so it needs –yes.

Fields

§page: String

The page’s slug, or its address.

§file: String

The file’s id or name, as wiki attachments lists them.

§

Download

Download one file attached to a page.

Fields

§page: String

The page’s slug or address — or the file’s own, <slug>/.files/<name>.

§file: Option<String>

The file’s id or name, as wiki attachments lists them; not needed when the first argument is the file’s address.

§out: PathBuf

Directory to write into.

§force: bool

Overwrite a file that is already there.

Trait Implementations§

Source§

impl Debug for WikiCommand

Source§

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

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

impl FromArgMatches for WikiCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for WikiCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

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
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<T> Paint for T
where T: ?Sized,

Source§

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 primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

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>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

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 bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

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 mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
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.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

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);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
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: Sized + 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: Sized + 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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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