Skip to main content

Scale

Trait Scale 

Source
pub trait Scale: Copy + Debug {
    const NAME: &'static str;
}
Expand description

A unit an offset can be counted in.

Sealed by construction: the three implementors below are the only ones, and the trait’s only members are constants, so a consumer cannot invent a fourth scale that conversion does not handle.

Required Associated Constants§

Source

const NAME: &'static str

How this scale names itself in a diagnostic.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Scale for Bytes

Source§

const NAME: &'static str = "bytes"

Source§

impl Scale for Chars

Source§

const NAME: &'static str = "chars"

Source§

impl Scale for Utf16Units

Source§

const NAME: &'static str = "utf16"