Configuration

Struct Configuration 

Source
pub struct Configuration<'mc>(/* private fields */);

Implementations§

Source§

impl<'mc> Configuration<'mc>

Source

pub fn add_default( &self, path: impl Into<String>, value: JObject<'mc>, ) -> Result<(), Box<dyn Error>>

Sets the default value of the given path as provided.

If no source {@link Configuration} was provided as a default collection, then a new {@link MemoryConfiguration} will be created to hold the new default value.

If value is null, the value will be removed from the default Configuration source.

Source

pub fn add_defaults( &self, defaults: impl Into<Configuration<'mc>>, ) -> Result<(), Box<dyn Error>>

Sets the default values of the given paths as provided.

If no source {@link Configuration} was provided as a default collection, then a new {@link MemoryConfiguration} will be created to hold the new default value.

This method will not hold a reference to the specified Configuration, nor will it automatically update if that Configuration ever changes. If you require this, you should set the default source with {@link #setDefaults(org.bukkit.configuration.Configuration)}.

Source

pub fn set_defaults( &self, defaults: impl Into<Configuration<'mc>>, ) -> Result<(), Box<dyn Error>>

Sets the source of all default values for this {@link Configuration}.

If a previous source was set, or previous default values were defined, then they will not be copied to the new source.

Source

pub fn defaults(&self) -> Result<Option<Configuration<'mc>>, Box<dyn Error>>

Gets the source {@link Configuration} for this configuration.

If no configuration source was set, but default values were added, then a {@link MemoryConfiguration} will be returned. If no source was set and no defaults were set, then this method will return null.

Source

pub fn options(&self) -> Result<ConfigurationOptions<'mc>, Box<dyn Error>>

Gets the {@link ConfigurationOptions} for this {@link Configuration}.

All setters through this method are chainable.

Source

pub fn get_keys(&self, deep: bool) -> Result<JavaSet<'mc>, Box<dyn Error>>

Gets a set containing all keys in this section.

If deep is set to true, then this will contain all the keys within any child {@link ConfigurationSection}s (and their children, etc). These will be in a valid path notation for you to use.

If deep is set to false, then this will contain only the keys of any direct children, and not their own children.

Source

pub fn get_values(&self, deep: bool) -> Result<JavaMap<'mc>, Box<dyn Error>>

Gets a Map containing all keys and their values for this section.

If deep is set to true, then this will contain all the keys and values within any child {@link ConfigurationSection}s (and their children, etc). These keys will be in a valid path notation for you to use.

If deep is set to false, then this will contain only the keys and values of any direct children, and not their own children.

Source

pub fn contains( &self, path: impl Into<String>, ignore_default: Option<bool>, ) -> Result<bool, Box<dyn Error>>

Checks if this {@link ConfigurationSection} contains the given path.

If the value for the requested path does not exist, the boolean parameter of true has been specified, a default value for the path exists, this will return true.

If a boolean parameter of false has been specified, true will only be returned if there is a set value for the specified path.

Source

pub fn is_set(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if this {@link ConfigurationSection} has a value set for the given path.

If the value for the requested path does not exist but a default value has been specified, this will still return false.

Source

pub fn current_path(&self) -> Result<Option<String>, Box<dyn Error>>

Gets the path of this {@link ConfigurationSection} from its root {@link Configuration}

For any {@link Configuration} themselves, this will return an empty string.

If the section is no longer contained within its root for any reason, such as being replaced with a different value, this may return null.

To retrieve the single name of this section, that is, the final part of the path returned by this method, you may use {@link #getName()}.

Source

pub fn name(&self) -> Result<String, Box<dyn Error>>

Gets the name of this individual {@link ConfigurationSection}, in the path.

This will always be the final part of {@link #getCurrentPath()}, unless the section is orphaned.

Source

pub fn root(&self) -> Result<Option<Configuration<'mc>>, Box<dyn Error>>

Gets the root {@link Configuration} that contains this {@link ConfigurationSection}

For any {@link Configuration} themselves, this will return its own object.

If the section is no longer contained within its root for any reason, such as being replaced with a different value, this may return null.

Source

pub fn parent( &self, ) -> Result<Option<ConfigurationSection<'mc>>, Box<dyn Error>>

Gets the parent {@link ConfigurationSection} that directly contains this {@link ConfigurationSection}.

For any {@link Configuration} themselves, this will return null.

If the section is no longer contained within its parent for any reason, such as being replaced with a different value, this may return null.

Source

pub fn get( &self, path: impl Into<String>, def: Option<JObject<'mc>>, ) -> Result<Option<JObject<'mc>>, Box<dyn Error>>

Gets the requested Object by path, returning a default value if not found.

If the Object does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn set( &self, path: impl Into<String>, value: JObject<'mc>, ) -> Result<(), Box<dyn Error>>

Sets the specified path to the given value.

If value is null, the entry will be removed. Any existing entry will be replaced, regardless of what the new value is.

Some implementations may have limitations on what you may store. See their individual javadocs for details. No implementations should allow you to store {@link Configuration}s or {@link ConfigurationSection}s, please use {@link #createSection(java.lang.String)} for that.

Source

pub fn create_section( &self, path: impl Into<String>, map: Option<impl Into<JavaMap<'mc>>>, ) -> Result<ConfigurationSection<'mc>, Box<dyn Error>>

Creates a {@link ConfigurationSection} at the specified path, with specified values.

Any value that was previously set at this path will be overwritten. If the previous value was itself a {@link ConfigurationSection}, it will be orphaned.

Source

pub fn get_string( &self, path: impl Into<String>, def: Option<impl Into<String>>, ) -> Result<Option<String>, Box<dyn Error>>

Gets the requested String by path, returning a default value if not found.

If the String does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_string(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a String.

If the path exists but is not a String, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a String and return appropriately.

Source

pub fn get_int( &self, path: impl Into<String>, def: Option<i32>, ) -> Result<i32, Box<dyn Error>>

Gets the requested int by path, returning a default value if not found.

If the int does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_int(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if the specified path is an int.

If the path exists but is not a int, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a int and return appropriately.

Source

pub fn get_boolean( &self, path: impl Into<String>, def: Option<bool>, ) -> Result<bool, Box<dyn Error>>

Gets the requested boolean by path, returning a default value if not found.

If the boolean does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_boolean( &self, path: impl Into<String>, ) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a boolean.

If the path exists but is not a boolean, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a boolean and return appropriately.

Source

pub fn get_double( &self, path: impl Into<String>, def: Option<f64>, ) -> Result<f64, Box<dyn Error>>

Gets the requested double by path, returning a default value if not found.

If the double does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_double(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a double.

If the path exists but is not a double, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a double and return appropriately.

Source

pub fn get_long( &self, path: impl Into<String>, def: Option<i64>, ) -> Result<i64, Box<dyn Error>>

Gets the requested long by path, returning a default value if not found.

If the long does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_long(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a long.

If the path exists but is not a long, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a long and return appropriately.

Source

pub fn is_list(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a List.

If the path exists but is not a List, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a List and return appropriately.

Source

pub fn get_string_list( &self, path: impl Into<String>, ) -> Result<Vec<String>, Box<dyn Error>>

Gets the requested List of String by path.

If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.

This method will attempt to cast any values into a String if possible, but may miss any values out if they are not compatible.

Source

pub fn get_object( &self, path: impl Into<String>, clazz: JClass<'mc>, def: Option<JObject<'mc>>, ) -> Result<Option<JObject<'mc>>, Box<dyn Error>>

Gets the requested object at the given path, returning a default value if not found If the Object does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}. Note: For example #getObject(path, String.class, def) is not equivalent to {@link #getString(String, String) #getString(path, def)} because {@link #getString(String, String) #getString(path, def)} converts internally all Objects to Strings. However, #getObject(path, Boolean.class, def) is equivalent to {@link #getBoolean(String, boolean) #getBoolean(path, def)} for example.

Source

pub fn get_serializable( &self, path: impl Into<String>, clazz: JClass<'mc>, def: Option<JObject<'mc>>, ) -> Result<Option<JObject<'mc>>, Box<dyn Error>>

Gets the requested {@link ConfigurationSerializable} object at the given path, returning a default value if not found If the Object does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn get_vector( &self, path: impl Into<String>, def: Option<impl Into<Vector<'mc>>>, ) -> Result<Option<Vector<'mc>>, Box<dyn Error>>

Gets the requested {@link Vector} by path, returning a default value if not found.

If the Vector does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_vector(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a Vector.

If the path exists but is not a Vector, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a Vector and return appropriately.

Source

pub fn get_offline_player( &self, path: impl Into<String>, def: Option<impl Into<OfflinePlayer<'mc>>>, ) -> Result<Option<OfflinePlayer<'mc>>, Box<dyn Error>>

Gets the requested {@link OfflinePlayer} by path, returning a default value if not found.

If the OfflinePlayer does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_offline_player( &self, path: impl Into<String>, ) -> Result<bool, Box<dyn Error>>

Checks if the specified path is an OfflinePlayer.

If the path exists but is not a OfflinePlayer, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a OfflinePlayer and return appropriately.

Source

pub fn get_item_stack( &self, path: impl Into<String>, def: Option<impl Into<ItemStack<'mc>>>, ) -> Result<Option<ItemStack<'mc>>, Box<dyn Error>>

Gets the requested {@link ItemStack} by path, returning a default value if not found.

If the ItemStack does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_item_stack( &self, path: impl Into<String>, ) -> Result<bool, Box<dyn Error>>

Checks if the specified path is an ItemStack.

If the path exists but is not a ItemStack, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a ItemStack and return appropriately.

Source

pub fn get_color( &self, path: impl Into<String>, def: Option<impl Into<Color<'mc>>>, ) -> Result<Option<Color<'mc>>, Box<dyn Error>>

Gets the requested {@link Color} by path, returning a default value if not found.

If the Color does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_color(&self, path: impl Into<String>) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a Color.

If the path exists but is not a Color, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a Color and return appropriately.

Source

pub fn get_location( &self, path: impl Into<String>, def: Option<impl Into<Location<'mc>>>, ) -> Result<Option<Location<'mc>>, Box<dyn Error>>

Gets the requested {@link Location} by path, returning a default value if not found.

If the Location does not exist then the specified default value will returned regardless of if a default has been identified in the root {@link Configuration}.

Source

pub fn is_location( &self, path: impl Into<String>, ) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a Location.

If the path exists but is not a Location, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a Location and return appropriately.

Source

pub fn get_configuration_section( &self, path: impl Into<String>, ) -> Result<Option<ConfigurationSection<'mc>>, Box<dyn Error>>

Gets the requested ConfigurationSection by path.

If the ConfigurationSection does not exist but a default value has been specified, this will return the default value. If the ConfigurationSection does not exist and no default value was specified, this will return null.

Source

pub fn is_configuration_section( &self, path: impl Into<String>, ) -> Result<bool, Box<dyn Error>>

Checks if the specified path is a ConfigurationSection.

If the path exists but is not a ConfigurationSection, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a ConfigurationSection and return appropriately.

Source

pub fn default_section( &self, ) -> Result<Option<ConfigurationSection<'mc>>, Box<dyn Error>>

Gets the equivalent {@link ConfigurationSection} from the default {@link Configuration} defined in {@link #getRoot()}.

If the root contains no defaults, or the defaults doesn’t contain a value for this path, or the value at this path is not a {@link ConfigurationSection} then this will return null.

Source

pub fn get_comments( &self, path: impl Into<String>, ) -> Result<Vec<String>, Box<dyn Error>>

Gets the requested comment list by path.

If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line.

Source

pub fn get_inline_comments( &self, path: impl Into<String>, ) -> Result<Vec<String>, Box<dyn Error>>

Gets the requested inline comment list by path.

If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line.

Source

pub fn set_comments( &self, path: impl Into<String>, comments: Vec<JObject<'mc>>, ) -> Result<(), Box<dyn Error>>

Sets the comment list at the specified path.

If value is null, the comments will be removed. A null entry is an empty line and an empty String entry is an empty comment line. If the path does not exist, no comments will be set. Any existing comments will be replaced, regardless of what the new comments are.

Some implementations may have limitations on what persists. See their individual javadocs for details.

Source

pub fn set_inline_comments( &self, path: impl Into<String>, comments: Vec<JObject<'mc>>, ) -> Result<(), Box<dyn Error>>

Sets the inline comment list at the specified path.

If value is null, the comments will be removed. A null entry is an empty line and an empty String entry is an empty comment line. If the path does not exist, no comment will be set. Any existing comments will be replaced, regardless of what the new comments are.

Some implementations may have limitations on what persists. See their individual javadocs for details.

Source

pub fn instance_of(&self, other: impl Into<String>) -> Result<bool, Error>

Trait Implementations§

Source§

impl<'mc> Into<Configuration<'mc>> for MemoryConfiguration<'mc>

Source§

fn into(self) -> Configuration<'mc>

Converts this type into the (usually inferred) input type.
Source§

impl<'mc> Into<ConfigurationSection<'mc>> for Configuration<'mc>

Source§

fn into(self) -> ConfigurationSection<'mc>

Converts this type into the (usually inferred) input type.
Source§

impl<'mc> JNIInstantiatable<'mc> for Configuration<'mc>

Source§

fn from_raw( env: &SharedJNIEnv<'mc>, obj: JObject<'mc>, ) -> Result<Self, Box<dyn Error>>

Source§

impl<'mc> JNIRaw<'mc> for Configuration<'mc>

Source§

fn jni_ref(&self) -> SharedJNIEnv<'mc>

Source§

fn jni_object(&self) -> JObject<'mc>

Auto Trait Implementations§

§

impl<'mc> !Freeze for Configuration<'mc>

§

impl<'mc> !RefUnwindSafe for Configuration<'mc>

§

impl<'mc> !Send for Configuration<'mc>

§

impl<'mc> !Sync for Configuration<'mc>

§

impl<'mc> Unpin for Configuration<'mc>

§

impl<'mc> UnwindSafe for Configuration<'mc>

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