pub struct EnvDescription {Show 23 fields
pub os: String,
pub usize_width: u8,
pub ctb_version: String,
pub cwd: Option<PathBuf>,
pub local_ips: Vec<IpAddr>,
pub public_ips: Vec<IpAddr>,
pub system_time_resolution_nanos: Option<u128>,
pub server_system_time_offset_nanos: Option<i128>,
pub is_release_build: bool,
pub is_debug_build: bool,
pub is_cargo_target_binary: bool,
pub is_in_test: bool,
pub is_branded_build: bool,
pub is_official_signed_build: bool,
pub is_cli_lightweight: bool,
pub is_workspace: bool,
pub is_workspace_main_process: bool,
pub is_service_subprocess: bool,
pub is_official_public_website: bool,
pub is_public_website: bool,
pub is_local: bool,
pub kernel_version: Option<String>,
pub supported_formats: Vec<FormatId>,
}Expand description
Serializes to a format where omitted fields assume default values on JSON deserialization. Unknown JSON fields are rejected; JSON is a debugging representation, not a lossless document interchange format.
Fields§
§os: String§usize_width: u8§ctb_version: String§cwd: Option<PathBuf>§local_ips: Vec<IpAddr>§public_ips: Vec<IpAddr>§system_time_resolution_nanos: Option<u128>§server_system_time_offset_nanos: Option<i128>§is_release_build: bool§is_debug_build: bool§is_cargo_target_binary: bool§is_in_test: bool§is_branded_build: bool§is_official_signed_build: bool§is_cli_lightweight: bool§is_workspace: bool§is_workspace_main_process: bool§is_service_subprocess: bool§is_official_public_website: bool§is_public_website: bool§is_local: bool§kernel_version: Option<String>§supported_formats: Vec<FormatId>Authoritative format identifiers representing this environment.
This flattened format list encapsulates all platform identity,
device capability, display server, and terminal protocol attributes.
Structured views corresponding to EnvironmentIdentity and
EnvironmentCapabilities are derived directly from this data and
can be retrieved via the Self::identity and Self::capabilities
accessors.
Implementations§
Source§impl EnvDescription
impl EnvDescription
Sourcepub fn encode_fields(&self, mst: &mut DcWriter<'_>) -> Result<(), Error>
pub fn encode_fields(&self, mst: &mut DcWriter<'_>) -> Result<(), Error>
Encodes the fields of this struct without boundary delimiters.
pub fn encode_fields_with_context( &self, mst: &mut DcWriter<'_>, context: &SharedValueContext, ) -> Result<(), Error>
Sourcepub fn decode_field(
&mut self,
tag: impl Into<u128>,
ctx: &mut DcProjectionContext<'_, '_>,
node_id: NodeId,
) -> Result<bool, Error>
pub fn decode_field( &mut self, tag: impl Into<u128>, ctx: &mut DcProjectionContext<'_, '_>, node_id: NodeId, ) -> Result<bool, Error>
Decodes a single field corresponding to tag from reader.
Returns true if the tag belonged to this struct and was consumed.
Source§impl EnvDescription
impl EnvDescription
Sourcepub fn local_ipv4(&self) -> Option<Ipv4Addr>
pub fn local_ipv4(&self) -> Option<Ipv4Addr>
First local IPv4 address if present in local_ips.
Sourcepub fn local_ipv6(&self) -> Option<Ipv6Addr>
pub fn local_ipv6(&self) -> Option<Ipv6Addr>
First local IPv6 address if present in local_ips.
Sourcepub fn public_ipv4(&self) -> Option<Ipv4Addr>
pub fn public_ipv4(&self) -> Option<Ipv4Addr>
First public IPv4 address if present in public_ips.
Sourcepub fn public_ipv6(&self) -> Option<Ipv6Addr>
pub fn public_ipv6(&self) -> Option<Ipv6Addr>
First public IPv6 address if present in public_ips.
Sourcepub fn identity(&self) -> EnvironmentIdentity
pub fn identity(&self) -> EnvironmentIdentity
Return the structured OS, kernel, libc, and architecture identity.
Sourcepub fn capabilities(&self) -> EnvironmentCapabilities
pub fn capabilities(&self) -> EnvironmentCapabilities
Return the active display, terminal, and renderer capabilities.
Sourcepub fn os_family(&self) -> OsFamily
pub fn os_family(&self) -> OsFamily
Returns the operating system family where this environment originated.
Sourcepub fn process_role(&self) -> ProcessRole
pub fn process_role(&self) -> ProcessRole
Return the execution role of the current process within the workspace architecture.
Sourcepub fn all_format_ids(&self) -> Vec<FormatId>
pub fn all_format_ids(&self) -> Vec<FormatId>
Returns all [FormatId] elements that apply to this environment
(identity, capabilities, and families).
Sourcepub fn has_format(&self, format: FormatId) -> bool
pub fn has_format(&self, format: FormatId) -> bool
Check if this environment has a specific [FormatId] capability or identity.
Sourcepub fn is_os_compatible(&self, target_os: FormatId) -> bool
pub fn is_os_compatible(&self, target_os: FormatId) -> bool
Check if this environment is compatible with a given target OS format.
Sourcepub fn summary(&self) -> String
pub fn summary(&self) -> String
Produce a human-readable one-line summary string for this environment.
pub fn is_unix(&self) -> bool
pub fn is_linux(&self) -> bool
pub fn is_windows(&self) -> bool
pub fn is_wine(&self) -> bool
pub fn is_mac_os_10_or_newer(&self) -> bool
pub fn is_apple_ios(&self) -> bool
pub fn is_watchos(&self) -> bool
pub fn is_tvos(&self) -> bool
pub fn is_visionos(&self) -> bool
pub fn is_darwin(&self) -> bool
pub fn looks_like_gnustep(&self) -> bool
pub fn looks_like_nextstep_or_openstep(&self) -> bool
pub fn is_bsd(&self) -> bool
pub fn is_openbsd(&self) -> bool
pub fn is_dragonfly(&self) -> bool
pub fn is_freebsd(&self) -> bool
pub fn is_netbsd(&self) -> bool
pub fn is_browser_vm(&self) -> bool
pub fn is_browser_vm_fullscreen(&self) -> bool
pub fn is_browser_vm_mobile(&self) -> bool
pub fn is_v86(&self) -> bool
pub fn is_pwa(&self) -> bool
pub fn is_pwa_mobile(&self) -> bool
pub fn is_webui(&self) -> bool
pub fn is_webui_in_system_browser(&self) -> bool
pub fn is_webui_in_webview(&self) -> bool
pub fn is_gui(&self) -> bool
pub fn is_cli(&self) -> bool
pub fn is_cli_tty(&self) -> bool
pub fn is_cli_videoterminal(&self) -> bool
Sourcepub fn current() -> EnvDescription
pub fn current() -> EnvDescription
Alias for Self::capture.
Sourcepub fn ctb_version_semver(&self) -> Version
pub fn ctb_version_semver(&self) -> Version
Parse ctb_version as a semver semver::Version.
Sourcepub fn to_json(&self) -> Result<String, Error>
pub fn to_json(&self) -> Result<String, Error>
Serialize this environment description to a compact JSON string.
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Serialize this environment description to a pretty-printed JSON string.
Trait Implementations§
Source§impl Clone for EnvDescription
impl Clone for EnvDescription
Source§fn clone(&self) -> EnvDescription
fn clone(&self) -> EnvDescription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DcForgivingDefault for EnvDescription
impl DcForgivingDefault for EnvDescription
Source§fn dc_forgiving_default() -> EnvDescription
fn dc_forgiving_default() -> EnvDescription
Source§impl DcMixedDecode for EnvDescription
impl DcMixedDecode for EnvDescription
Source§fn decode_dc_node(
ctx: &mut DcProjectionContext<'_, '_>,
node_id: NodeId,
) -> Result<EnvDescription, Error>
fn decode_dc_node( ctx: &mut DcProjectionContext<'_, '_>, node_id: NodeId, ) -> Result<EnvDescription, Error>
Source§fn decode_dc_document(
ctx: &mut DcProjectionContext<'_, '_>,
roots: &[NodeId],
) -> Result<(Self, usize), Error>
fn decode_dc_document( ctx: &mut DcProjectionContext<'_, '_>, roots: &[NodeId], ) -> Result<(Self, usize), Error>
Source§impl DcMixedEncode for EnvDescription
impl DcMixedEncode for EnvDescription
Source§fn encode_dc_mixed_to(&self, mst: &mut DcWriter<'_>) -> Result<(), Error>
fn encode_dc_mixed_to(&self, mst: &mut DcWriter<'_>) -> Result<(), Error>
Source§fn encode_dc_mixed_to_with_context(
&self,
mst: &mut DcWriter<'_>,
context: &SharedValueContext,
) -> Result<(), Error>
fn encode_dc_mixed_to_with_context( &self, mst: &mut DcWriter<'_>, context: &SharedValueContext, ) -> Result<(), Error>
fn encode_dc_mixed(&self, mst: &mut DcMstring) -> Result<(), Error>
fn encode_dc_mixed_with_context( &self, mst: &mut DcMstring, context: &SharedValueContext, ) -> Result<(), Error>
fn encode_format_elements_with_context( &self, format: DcChar, mst: &mut DcMstring, context: &SharedValueContext, ) -> Result<(), Error>
Source§fn write_dc_mixed(&self, output: &mut dyn Write) -> Result<(), Error>
fn write_dc_mixed(&self, output: &mut dyn Write) -> Result<(), Error>
Source§fn to_dc_mixed(&self) -> Result<DcMstring, Error>
fn to_dc_mixed(&self) -> Result<DcMstring, Error>
Source§fn to_dc_string(&self) -> Result<DcString, Error>
fn to_dc_string(&self) -> Result<DcString, Error>
Source§fn encode_format_elements_to_with_context(
&self,
format: DcChar,
mst: &mut DcWriter<'_>,
context: &SharedValueContext,
) -> Result<(), Error>
fn encode_format_elements_to_with_context( &self, format: DcChar, mst: &mut DcWriter<'_>, context: &SharedValueContext, ) -> Result<(), Error>
Dc 511 [format] ... Dc 512 format representation container.Source§impl DcMixedFields for EnvDescription
impl DcMixedFields for EnvDescription
Source§fn dc_field_owner() -> &'static str
fn dc_field_owner() -> &'static str
Source§fn encode_dc_field_to(
&self,
field: &str,
mst: &mut DcWriter<'_>,
) -> Result<(), Error>
fn encode_dc_field_to( &self, field: &str, mst: &mut DcWriter<'_>, ) -> Result<(), Error>
fn encode_dc_field( &self, field: &str, target: &mut DcMstring, ) -> Result<(), Error>
fn encode_dc_map_field( &self, field: &str, target: &mut DcMstring, encoding: DcKvMapEncoding, ) -> Result<(), Error>
Source§fn encode_dc_map_field_to(
&self,
field: &str,
target: &mut DcWriter<'_>,
encoding: DcKvMapEncoding,
) -> Result<(), Error>
fn encode_dc_map_field_to( &self, field: &str, target: &mut DcWriter<'_>, encoding: DcKvMapEncoding, ) -> Result<(), Error>
Source§fn accepts_dc_tag(_tag: u128) -> bool
fn accepts_dc_tag(_tag: u128) -> bool
tag is one of this record’s direct or flattened field tags.Source§fn encode_fields_with_context(
&self,
_mst: &mut DcWriter<'_>,
_context: &SharedValueContext,
) -> Result<(), Error>
fn encode_fields_with_context( &self, _mst: &mut DcWriter<'_>, _context: &SharedValueContext, ) -> Result<(), Error>
Source§fn decode_field(
&mut self,
_tag: u128,
_ctx: &mut DcProjectionContext<'_, '_>,
_node_id: NodeId,
) -> Result<bool, Error>
fn decode_field( &mut self, _tag: u128, _ctx: &mut DcProjectionContext<'_, '_>, _node_id: NodeId, ) -> Result<bool, Error>
Source§impl DcMixedFlattened for EnvDescription
impl DcMixedFlattened for EnvDescription
type State = Vec<FieldProjectionSpec>
fn encode_flattened_fields( &self, mst: &mut DcWriter<'_>, context: &SharedValueContext, ) -> Result<(), Error>
fn decode_flattened_field( state: &mut <EnvDescription as DcMixedFlattened>::State, tag: u128, ctx: &mut DcProjectionContext<'_, '_>, val_id: NodeId, source_node: NodeId, ) -> Result<bool, Error>
fn finish_flattened( state: <EnvDescription as DcMixedFlattened>::State, ctx: &mut DcProjectionContext<'_, '_>, ) -> Result<EnvDescription, Error>
fn encode_empty_flattened_marker( &self, _mst: &mut DcWriter<'_>, _context: &SharedValueContext, ) -> Result<(), Error>
Source§impl Debug for EnvDescription
impl Debug for EnvDescription
Source§impl Default for EnvDescription
impl Default for EnvDescription
Source§fn default() -> EnvDescription
fn default() -> EnvDescription
Source§impl<'de> Deserialize<'de> for EnvDescriptionwhere
EnvDescription: Default,
impl<'de> Deserialize<'de> for EnvDescriptionwhere
EnvDescription: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnvDescription, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnvDescription, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EnvDescription
impl PartialEq for EnvDescription
Source§impl Serialize for EnvDescription
impl Serialize for EnvDescription
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for EnvDescription
impl StructuralPartialEq for EnvDescription
Auto Trait Implementations§
impl Freeze for EnvDescription
impl RefUnwindSafe for EnvDescription
impl Send for EnvDescription
impl Sync for EnvDescription
impl Unpin for EnvDescription
impl UnwindSafe for EnvDescription
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
fn exact_into(self) -> U
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§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();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§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();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§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();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§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();§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>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.§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);§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)
§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
fn saturating_into(self) -> U
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.