Skip to main content

DefaultEnglishLocalizer

Struct DefaultEnglishLocalizer 

Source
pub struct DefaultEnglishLocalizer;
Expand description

Default English localizer used by the crate.

Trait Implementations§

Source§

impl Clone for DefaultEnglishLocalizer

Source§

fn clone(&self) -> DefaultEnglishLocalizer

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DefaultEnglishLocalizer

Source§

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

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

impl Default for DefaultEnglishLocalizer

Source§

fn default() -> DefaultEnglishLocalizer

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

impl Localizer for DefaultEnglishLocalizer

Source§

fn attach_location<'a>(&self, base: Cow<'a, str>, loc: Location) -> Cow<'a, str>

Attach a location suffix to base. Read more
Source§

fn root_path_label(&self) -> Cow<'static, str>

Label used when a path has no leaf. Read more
Source§

fn alias_defined_at(&self, defined: Location) -> String

Suffix for alias-related errors when a distinct defined-location is available. Read more
Source§

fn validation_issue_line( &self, resolved_path: &str, entry: &str, loc: Option<Location>, ) -> String

Render one validation issue line. Read more
Source§

fn join_validation_issues(&self, lines: &[String]) -> String

Join multiple validation issues into one message. Read more
Source§

fn defined(&self) -> Cow<'static, str>

Label used for a snippet window when the location is known and considered the “definition” site. Read more
Source§

fn defined_here(&self) -> Cow<'static, str>

Label used for a snippet window when we only have a “defined here” location. Read more
Source§

fn value_used_here(&self) -> Cow<'static, str>

Label used for the primary snippet window when an aliased/anchored value is used at a different location than where it was defined. Read more
Source§

fn defined_window(&self) -> Cow<'static, str>

Label used for the secondary snippet window that points at the anchor definition. Read more
Source§

fn validation_base_message(&self, entry: &str, resolved_path: &str) -> String

Compose the base validation message used in snippet rendering. Read more
Source§

fn invalid_here(&self, base: &str) -> String

Compose the “invalid here” prefix for the primary snippet message. Read more
Source§

fn value_comes_from_the_anchor(&self, def: Location) -> String

Intro line printed between the primary and secondary snippet windows for anchor/alias (“indirect value”) cases. Read more
Source§

fn snippet_location_prefix(&self, loc: Location) -> String

Optional hook to override the location prefix used for snippet titles Read more
Source§

fn override_external_message<'a>( &self, _msg: ExternalMessage<'a>, ) -> Option<Cow<'a, str>>

Best-effort hook to override/translate dependency-provided message text. Read more
Source§

impl Copy for DefaultEnglishLocalizer

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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