Skip to main content

UserProfile

Enum UserProfile 

Source
pub enum UserProfile {
    PowerUser,
    Gamer,
    Streamer,
    RemoteWorker,
    Casual,
}
Expand description

Pre-defined user profiles.

§Example

use netspeed_cli::profiles::UserProfile;

// Parse from a string name
assert_eq!(UserProfile::from_name("gamer"), Some(UserProfile::Gamer));
assert_eq!(UserProfile::from_name("streamer"), Some(UserProfile::Streamer));
assert_eq!(UserProfile::from_name("invalid"), None);

// Round-trip: name() → from_name()
assert_eq!(UserProfile::from_name(UserProfile::RemoteWorker.name()), Some(UserProfile::RemoteWorker));

// Default is PowerUser
assert_eq!(UserProfile::default(), UserProfile::PowerUser);

Variants§

§

PowerUser

Tech-savvy users who want all metrics and detailed analysis.

§

Gamer

Online gamers focused on latency, jitter, and bufferbloat.

§

Streamer

Content consumers (Netflix, YouTube, etc.) focused on download speed.

§

RemoteWorker

Work-from-home professionals focused on upload and stability.

§

Casual

Basic users who want a simple pass/fail assessment.

Implementations§

Source§

impl UserProfile

Source

pub const TYPE_NAME: &'static str = "profile"

Type identifier for error messages (DIP: shared validation pattern).

Source

pub const VALID_NAMES: &'static [&'static str]

List of valid profile names for error messages.

Source

pub fn from_name(name: &str) -> Option<Self>

Get profile from string name (case-insensitive).

Returns Some(UserProfile) for valid names (including aliases like "poweruser" and "remote"), or None for unrecognized names.

§Example
use netspeed_cli::profiles::UserProfile;

// Canonical names
assert_eq!(UserProfile::from_name("power-user"), Some(UserProfile::PowerUser));
assert_eq!(UserProfile::from_name("gamer"), Some(UserProfile::Gamer));
assert_eq!(UserProfile::from_name("streamer"), Some(UserProfile::Streamer));
assert_eq!(UserProfile::from_name("remote-worker"), Some(UserProfile::RemoteWorker));
assert_eq!(UserProfile::from_name("casual"), Some(UserProfile::Casual));

// Aliases
assert_eq!(UserProfile::from_name("poweruser"), Some(UserProfile::PowerUser));
assert_eq!(UserProfile::from_name("remote"), Some(UserProfile::RemoteWorker));

// Case-insensitive
assert_eq!(UserProfile::from_name("GAMER"), Some(UserProfile::Gamer));
assert_eq!(UserProfile::from_name("Casual"), Some(UserProfile::Casual));

// Invalid names return None
assert_eq!(UserProfile::from_name("admin"), None);
Source

pub fn is_valid_name(name: &str) -> bool

Check if a profile name is valid without returning the profile.

§Example
use netspeed_cli::profiles::UserProfile;

// Canonical names are valid
assert!(UserProfile::is_valid_name("power-user"));
assert!(UserProfile::is_valid_name("gamer"));

// Aliases are also valid
assert!(UserProfile::is_valid_name("poweruser"));
assert!(UserProfile::is_valid_name("remote"));

// Case-insensitive
assert!(UserProfile::is_valid_name("GAMER"));

// Invalid names
assert!(!UserProfile::is_valid_name("admin"));
assert!(!UserProfile::is_valid_name(""));
Source

pub fn validate(name: &str) -> Result<(), String>

Validate this profile name and return error message if invalid.

Returns Ok(()) if valid, Err(msg) with the list of valid options if invalid. Use this for config-file validation where you need an error message; use from_name() if you just need the UserProfile value.

§Example
use netspeed_cli::profiles::UserProfile;

// Valid names pass validation
assert!(UserProfile::validate("power-user").is_ok());
assert!(UserProfile::validate("gamer").is_ok());
assert!(UserProfile::validate("streamer").is_ok());
assert!(UserProfile::validate("remote-worker").is_ok());
assert!(UserProfile::validate("casual").is_ok());

// Invalid names produce a descriptive error
let err = UserProfile::validate("admin").unwrap_err();
assert!(err.contains("Invalid profile"));
assert!(err.contains("admin"));
assert!(err.contains("gamer"));  // lists valid options
Source

pub fn name(&self) -> &'static str

CLI-friendly name for the profile.

§Example
use netspeed_cli::profiles::UserProfile;

assert_eq!(UserProfile::PowerUser.name(), "power-user");
assert_eq!(UserProfile::Gamer.name(), "gamer");
assert_eq!(UserProfile::Streamer.name(), "streamer");
assert_eq!(UserProfile::RemoteWorker.name(), "remote-worker");
assert_eq!(UserProfile::Casual.name(), "casual");
Source

pub fn display_name(&self) -> &'static str

Display name with emoji for headers.

§Example
use netspeed_cli::profiles::UserProfile;

assert_eq!(UserProfile::PowerUser.display_name(), "⚙️ Power User");
assert_eq!(UserProfile::Gamer.display_name(), "🎮 Gamer");
assert_eq!(UserProfile::Streamer.display_name(), "📺 Streamer");
assert_eq!(UserProfile::RemoteWorker.display_name(), "💼 Remote Worker");
assert_eq!(UserProfile::Casual.display_name(), "👤 Casual");
Source

pub fn description(&self) -> &'static str

Description for help text.

§Example
use netspeed_cli::profiles::UserProfile;

// Each description highlights the profile's focus
assert!(UserProfile::Gamer.description().contains("Latency"));
assert!(UserProfile::Gamer.description().contains("jitter"));

assert!(UserProfile::Streamer.description().contains("Download"));
assert!(UserProfile::Streamer.description().contains("streaming"));

assert!(UserProfile::RemoteWorker.description().contains("Upload"));
assert!(UserProfile::RemoteWorker.description().contains("video calls"));

assert!(UserProfile::Casual.description().contains("pass/fail"));

assert!(UserProfile::PowerUser.description().contains("All metrics"));
Source

pub fn scoring_weights(&self) -> (f64, f64, f64, f64)

Scoring weights for overall connection rating (ping, jitter, download, upload).

Returns (ping_weight, jitter_weight, download_weight, upload_weight). Weights always sum to ~1.0, but the distribution reflects each profile’s priorities.

§Example
use netspeed_cli::profiles::UserProfile;

// Gamer prioritizes latency and jitter
let (ping, jitter, dl, ul) = UserProfile::Gamer.scoring_weights();
assert!(ping > dl, "gamer weights ping over download");
assert!(jitter > ul, "gamer weights jitter over upload");

// Streamer prioritizes download speed
let (_, _, dl, _) = UserProfile::Streamer.scoring_weights();
assert!(dl >= 0.5, "streamer weights download highest");

// RemoteWorker prioritizes upload speed
let (_, _, _, ul) = UserProfile::RemoteWorker.scoring_weights();
assert!(ul >= 0.35, "remote-worker weights upload highest");

// All profiles' weights sum to ~1.0
for profile in [UserProfile::PowerUser, UserProfile::Gamer,
               UserProfile::Streamer, UserProfile::RemoteWorker,
               UserProfile::Casual] {
    let (p, j, d, u) = profile.scoring_weights();
    assert!((p + j + d + u - 1.0).abs() < 0.01,
            "weights must sum to ~1.0 for {profile:?}");
}
Source

pub fn excellent_speed_threshold(&self) -> f64

Speed rating thresholds for “Excellent” (in Mbps).

Lower values = easier to achieve. PowerUser demands the highest bandwidth; Casual is satisfied with the least.

§Example
use netspeed_cli::profiles::UserProfile;

// PowerUser requires 500 Mbps for "Excellent"
assert_eq!(UserProfile::PowerUser.excellent_speed_threshold(), 500.0);

// Gamer and RemoteWorker need only 100 Mbps (latency matters more)
assert_eq!(UserProfile::Gamer.excellent_speed_threshold(), 100.0);
assert_eq!(UserProfile::RemoteWorker.excellent_speed_threshold(), 100.0);

// Streamer needs 200 Mbps (4K streaming headroom)
assert_eq!(UserProfile::Streamer.excellent_speed_threshold(), 200.0);

// Casual is happy with 50 Mbps
assert_eq!(UserProfile::Casual.excellent_speed_threshold(), 50.0);
Source

pub fn excellent_ping_threshold(&self) -> f64

Ping rating thresholds for “Excellent” (in ms).

Lower values = harder to achieve. Gamer demands ultra-low latency; Casual/Streamer tolerate higher ping.

§Example
use netspeed_cli::profiles::UserProfile;

// Gamer needs ≤5 ms for "Excellent" ping
assert_eq!(UserProfile::Gamer.excellent_ping_threshold(), 5.0);

// PowerUser needs ≤10 ms
assert_eq!(UserProfile::PowerUser.excellent_ping_threshold(), 10.0);

// RemoteWorker tolerates ≤20 ms
assert_eq!(UserProfile::RemoteWorker.excellent_ping_threshold(), 20.0);

// Streamer and Casual are fine with ≤30 ms
assert_eq!(UserProfile::Streamer.excellent_ping_threshold(), 30.0);
assert_eq!(UserProfile::Casual.excellent_ping_threshold(), 30.0);
Source

pub fn excellent_jitter_threshold(&self) -> f64

Jitter rating thresholds for “Excellent” (in ms).

Lower values = harder to achieve. Gamer needs the most consistent latency; Casual/Streamer tolerate more variation.

§Example
use netspeed_cli::profiles::UserProfile;

// Gamer needs ≤1 ms jitter for "Excellent"
assert_eq!(UserProfile::Gamer.excellent_jitter_threshold(), 1.0);

// PowerUser needs ≤2 ms
assert_eq!(UserProfile::PowerUser.excellent_jitter_threshold(), 2.0);

// RemoteWorker tolerates ≤3 ms
assert_eq!(UserProfile::RemoteWorker.excellent_jitter_threshold(), 3.0);

// Streamer and Casual are fine with ≤5 ms
assert_eq!(UserProfile::Streamer.excellent_jitter_threshold(), 5.0);
assert_eq!(UserProfile::Casual.excellent_jitter_threshold(), 5.0);
Source

pub fn show_latency_details(&self) -> bool

Whether to show detailed latency section.

All profiles except Casual show latency details.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_latency_details());
assert!(UserProfile::Gamer.show_latency_details());
assert!(!UserProfile::Casual.show_latency_details()); // minimal output
Source

pub fn show_bufferbloat(&self) -> bool

Whether to show bufferbloat grade.

Only PowerUser and Gamer care about bufferbloat.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_bufferbloat());
assert!(UserProfile::Gamer.show_bufferbloat());
assert!(!UserProfile::Streamer.show_bufferbloat());
assert!(!UserProfile::Casual.show_bufferbloat());
Source

pub fn show_stability(&self) -> bool

Whether to show stability analysis (CV%).

PowerUser and RemoteWorker need consistent connections for their use cases.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_stability());
assert!(UserProfile::RemoteWorker.show_stability());
assert!(!UserProfile::Gamer.show_stability());
assert!(!UserProfile::Casual.show_stability());
Source

pub fn show_percentiles(&self) -> bool

Whether to show latency percentiles.

Only PowerUser sees percentile detail.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_percentiles());
assert!(!UserProfile::Gamer.show_percentiles());
assert!(!UserProfile::Casual.show_percentiles());
Source

pub fn show_usage_check(&self) -> bool

Whether to show usage check targets.

All profiles except Casual show usage checks.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_usage_check());
assert!(UserProfile::Gamer.show_usage_check());
assert!(!UserProfile::Casual.show_usage_check()); // minimal output
Source

pub fn show_estimates(&self) -> bool

Whether to show download time estimates.

PowerUser wants all metrics; Casual benefits from practical time estimates.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_estimates());
assert!(UserProfile::Casual.show_estimates());
assert!(!UserProfile::Gamer.show_estimates());
assert!(!UserProfile::Streamer.show_estimates());
Source

pub fn show_history(&self) -> bool

Whether to show historical comparison.

PowerUser tracks trends; RemoteWorker monitors connection reliability over time.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_history());
assert!(UserProfile::RemoteWorker.show_history());
assert!(!UserProfile::Gamer.show_history());
assert!(!UserProfile::Casual.show_history());
Source

pub fn show_ul_dl_ratio(&self) -> bool

Whether to show UL/DL ratio.

PowerUser wants all metrics; RemoteWorker cares about upload relative to download.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_ul_dl_ratio());
assert!(UserProfile::RemoteWorker.show_ul_dl_ratio());
assert!(!UserProfile::Streamer.show_ul_dl_ratio());
assert!(!UserProfile::Casual.show_ul_dl_ratio());
Source

pub fn show_peaks(&self) -> bool

Whether to show peak speeds.

All profiles except Casual show peak speeds.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_peaks());
assert!(UserProfile::Gamer.show_peaks());
assert!(!UserProfile::Casual.show_peaks()); // minimal output
Source

pub fn show_latency_under_load(&self) -> bool

Whether to show latency under load.

PowerUser wants all metrics; Gamer needs to know if loaded latency spikes.

§Example
use netspeed_cli::profiles::UserProfile;

assert!(UserProfile::PowerUser.show_latency_under_load());
assert!(UserProfile::Gamer.show_latency_under_load());
assert!(!UserProfile::Streamer.show_latency_under_load());
assert!(!UserProfile::Casual.show_latency_under_load());

Trait Implementations§

Source§

impl Clone for UserProfile

Source§

fn clone(&self) -> UserProfile

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for UserProfile

Source§

impl Debug for UserProfile

Source§

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

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

impl Default for UserProfile

Source§

fn default() -> UserProfile

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for UserProfile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for UserProfile

Source§

impl PartialEq for UserProfile

Source§

fn eq(&self, other: &UserProfile) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for UserProfile

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for UserProfile

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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