Struct readable::Runtime

source ·
pub struct Runtime(_, _);
Expand description

Human readable “audio/video runtime” in H:M:S format.

Runtime::from input can be:

Integer inputs are presumed to be in seconds.

Errors

The max input is 359999 seconds, or: 99:59:59.

If the input is larger than MAX_RUNTIME, UNKNOWN_RUNTIME is returned.

Inlining

If the feature flag inline_runtime is enabled, ALL possible outputs of Runtime are inlined as static bytes and any Runtime::from call will return said static bytes.

Warning: This feature is disabled by default. While it increases speed, it also heavily increases build time and binary size.

Formatting rules

  1. seconds always has leading 0.
  2. minutes only has a leading zero if hours isn’t 0.
  3. hours never has a leading 0.

Cloning

Copy is available.

The actual string used internally is not a String, but a 8 byte array buffer, literally: [u8; 8].

Since the max valid runtime is: 99:59:59 (8 characters, 359999 seconds), an 8 byte buffer is used and enables this type to have Copy.

The documentation will still refer to the inner buffer as a String. Anything returned will also be a String.

let a = Runtime::from(100_000_u64);

// Copy 'a', use 'b'.
let b = a;
assert!(b == 100_000_u32);

// We can still use 'a'
assert!(a == 100_000_u32);

Exceptions

To disable checks for these, (you are sure you don’t have NaN’s), enable the ignore_nan_inf feature flag.

Math

These operators are overloaded. They will always output a new Self:

  • Add +
  • Sub -
  • Div /
  • Mul *
  • Rem %

They can either be:

  • Combined with another Self: Runtime::from(1) + Runtime::from(1)
  • Or with the inner number itself: Runtime::from(1) + 1

They also have the same panic!() behavior on overflow as the normal ones, because internally, it is just calling .inner() $OPERATOR $NUMBER.

assert!(Runtime::from(10_u32) + 10 == Runtime::from(20_u32));
assert!(Runtime::from(10_u32) - 10 == Runtime::from(0_u32));
assert!(Runtime::from(10_u32) / 10 == Runtime::from(1_u32));
assert!(Runtime::from(10_u32) * 10 == Runtime::from(100_u32));
assert!(Runtime::from(10_u32) % 10 == Runtime::from(0_u32));

Overflow example (won’t panic, will return unknown):

let n = Runtime::from(u32::MAX) + u32::MAX;
assert!(n == Runtime::unknown());

Examples

// Always round down.
assert!(Runtime::from(11.1111) == "0:11");
assert!(Runtime::from(11.9999) == "0:11");

assert!(Runtime::from(111.111) == "1:51");
assert!(Runtime::from(111.999) == "1:51");

assert!(Runtime::from(11111.1) == "3:05:11");
assert!(Runtime::from(11111.9) == "3:05:11");

assert!(Runtime::from(0.0) == "0:00");
assert!(Runtime::from(1.0) == "0:01");
assert!(Runtime::from(1.9) == "0:01");
assert!(Runtime::from(2.0) == "0:02");

assert!(Runtime::from(f32::NAN) == "?:??");
assert!(Runtime::from(f64::INFINITY) == "?:??");

Implementations§

source§

impl Runtime

source

pub fn as_str(&self) -> &str

Return a borrowed str without consuming Self.

source

pub fn as_bytes(&self) -> &[u8]

Returns the valid byte slice of the inner String

These bytes can always safely be used for std::str::from_utf8_unchecked.

source

pub fn to_vec(&self) -> Vec<u8>

Return the bytes of the inner String as a Vec

source

pub fn into_vec(self) -> Vec<u8>

Return the bytes of the inner String as a Vec, consuming Self

source

pub const fn inner(&self) -> u32

Returns the inner number.

source

pub fn into_string(self) -> String

Consumes Self, returning the inner String.

source

pub fn into_raw(self) -> (u32, String)

Consumes Self, returning the inner parts.

source

pub fn head(&self, len: usize) -> &str

Return the first len bytes of this str.

This will return the full str if the len is longer than the actual inner str.

Since all readable types happen to only contain ASCII characters, all char’s are equal to 1 byte.

let date = Date::from_str("2021-12-11").unwrap();

assert!(date.head(5) == "2021-");
source

pub fn head_dot(&self, len: usize) -> String

Same as Self::head but returns a String ending with ...

This will return the full string without ... if the len is longer than the actual inner str.

let date = Date::from_str("2021-12-11").unwrap();

assert!(date.head_dot(4) == "2021...");
source

pub fn tail(&self, len: usize) -> &str

Return the last len bytes of this str.

This will return the full str if the len is longer than the actual inner str.

Since all readable types happen to only contain ASCII characters, all char’s are equal to 1 byte.

let date = Date::from_str("2021-12-11").unwrap();

assert!(date.tail(5) == "12-11");
source

pub fn tail_dot(&self, len: usize) -> String

Same as Self::tail but returns a String starting with ...

This will return the full string without ... if the len is longer than the actual inner str.

let date = Date::from_str("2021-12-11").unwrap();

assert!(date.tail_dot(5) == "...12-11");
source

pub fn head_tail(&self, head: usize, tail: usize) -> String

Return the first head bytes and last tail bytes of this string separated with ....

Since all readable types happen to only contain ASCII characters, all char’s are equal to 1 byte.

let date = Date::from_str("2021-12-11").unwrap();

assert!(date.head_tail(3, 2) == "202...11");
assert!(date.head_tail(3, 3) == "202...-11");
assert!(date.head_tail(3, 5) == "202...12-11");
source

pub const fn len(&self) -> usize

The length of the inner String

source

pub const fn is_empty(&self) -> bool

If the inner String is empty or not

source

pub const fn usize(&self) -> usize

Returns the inner number as a usize.

Notes

This function is only available on 64-bit platforms.

source

pub const fn to_buf(&self) -> [u8; 8]

Return the full inner buffer that represents the String.

These are guaranteed to be valid UTF-8 bytes.

Not all bytes are necessarily used, however. To find the valid portion of the string, use Self::len.

let u           = Unsigned::from(123_u8);
let buffer      = u.to_buf();
let valid_bytes = &buffer[0..u.len()];

// SAFETY: These bytes are always be valid UTF-8.
unsafe {
    let specified = std::str::from_utf8_unchecked(&valid_bytes);
    let all_bytes = std::str::from_utf8_unchecked(&buffer);

    // Bunch of trailing `\0\0\0`'s at the end.
    assert!(all_bytes != "123");
    assert!(specified == "123");
}
source

pub const fn into_buf(self) -> [u8; 8]

Same as Self::to_buf but consumes self.

source

pub const fn as_buf(&self) -> &[u8; 8]

Same as Self::to_buf but returns a borrowed array.

source

pub const fn to_buf_parts(&self) -> ([u8; 8], usize)

Same as Self::to_buf but returns the length as well.

source

pub const fn into_buf_parts(self) -> ([u8; 8], usize)

Same as Self::into_buf but returns the length as well.

source

pub const fn unknown() -> Self

assert!(Runtime::unknown() == 0);
assert!(Runtime::unknown() == "?:??");
source

pub const fn zero() -> Self

assert!(Runtime::zero() == 0);
assert!(Runtime::zero() == "0:00");
source

pub const fn second() -> Self

assert!(Runtime::second() == 1);
assert!(Runtime::second() == "0:01");
assert!(Runtime::second() == Runtime::from(1.0));
source

pub const fn minute() -> Self

assert!(Runtime::minute() == 60);
assert!(Runtime::minute() == "1:00");
assert!(Runtime::minute() == Runtime::from(60.0));
source

pub const fn hour() -> Self

assert!(Runtime::hour() == 3600);
assert!(Runtime::hour() == "1:00:00");
assert!(Runtime::hour() == Runtime::from(3600.0));
source

pub const fn max() -> Self

assert!(Runtime::max() == 359999);
assert!(Runtime::max() == "99:59:59");
assert!(Runtime::max() == Runtime::from(359999.0));

Trait Implementations§

source§

impl Add<&Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the + operator.
source§

fn add(self, other: &Runtime) -> Self

Performs the + operation. Read more
source§

impl Add<&Runtime> for u32

§

type Output = u32

The resulting type after applying the + operator.
source§

fn add(self, other: &Runtime) -> Self

Performs the + operation. Read more
source§

impl Add<&u32> for Runtime

§

type Output = Runtime

The resulting type after applying the + operator.
source§

fn add(self, other: &u32) -> Self

Performs the + operation. Read more
source§

impl Add<Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the + operator.
source§

fn add(self, other: Runtime) -> Self

Performs the + operation. Read more
source§

impl Add<Runtime> for u32

§

type Output = u32

The resulting type after applying the + operator.
source§

fn add(self, other: Runtime) -> Self

Performs the + operation. Read more
source§

impl Add<u32> for Runtime

§

type Output = Runtime

The resulting type after applying the + operator.
source§

fn add(self, other: u32) -> Self

Performs the + operation. Read more
source§

impl<'__de> BorrowDecode<'__de> for Runtime

source§

fn borrow_decode<__D: BorrowDecoder<'__de>>( decoder: &mut __D ) -> Result<Self, DecodeError>

Attempt to decode this type with the given BorrowDecode.
source§

impl Clone for Runtime

source§

fn clone(&self) -> Runtime

Returns a copy 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 Runtime

source§

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

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

impl Decode for Runtime

source§

fn decode<__D: Decoder>(decoder: &mut __D) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
source§

impl Default for Runtime

source§

fn default() -> Self

Calls Self::zero

source§

impl<'de> Deserialize<'de> for Runtime

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 Display for Runtime

source§

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

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

impl Div<&Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the / operator.
source§

fn div(self, other: &Runtime) -> Self

Performs the / operation. Read more
source§

impl Div<&Runtime> for u32

§

type Output = u32

The resulting type after applying the / operator.
source§

fn div(self, other: &Runtime) -> Self

Performs the / operation. Read more
source§

impl Div<&u32> for Runtime

§

type Output = Runtime

The resulting type after applying the / operator.
source§

fn div(self, other: &u32) -> Self

Performs the / operation. Read more
source§

impl Div<Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the / operator.
source§

fn div(self, other: Runtime) -> Self

Performs the / operation. Read more
source§

impl Div<Runtime> for u32

§

type Output = u32

The resulting type after applying the / operator.
source§

fn div(self, other: Runtime) -> Self

Performs the / operation. Read more
source§

impl Div<u32> for Runtime

§

type Output = Runtime

The resulting type after applying the / operator.
source§

fn div(self, other: u32) -> Self

Performs the / operation. Read more
source§

impl Encode for Runtime

source§

fn encode<__E: Encoder>(&self, encoder: &mut __E) -> Result<(), EncodeError>

Encode a given type.
source§

impl From<&Duration> for Runtime

source§

fn from(runtime: &Duration) -> Self

Converts to this type from the input type.
source§

impl From<&Instant> for Runtime

source§

fn from(runtime: &Instant) -> Self

Converts to this type from the input type.
source§

impl From<Duration> for Runtime

source§

fn from(runtime: Duration) -> Self

Converts to this type from the input type.
source§

impl From<Instant> for Runtime

source§

fn from(runtime: Instant) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Runtime

source§

fn from(runtime: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Runtime

source§

fn from(runtime: f64) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Runtime

source§

fn from(runtime: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Runtime

source§

fn from(runtime: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Runtime

source§

fn from(runtime: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Runtime

source§

fn from(runtime: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for Runtime

source§

fn from(runtime: usize) -> Self

Converts to this type from the input type.
source§

impl Hash for Runtime

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul<&Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the * operator.
source§

fn mul(self, other: &Runtime) -> Self

Performs the * operation. Read more
source§

impl Mul<&Runtime> for u32

§

type Output = u32

The resulting type after applying the * operator.
source§

fn mul(self, other: &Runtime) -> Self

Performs the * operation. Read more
source§

impl Mul<&u32> for Runtime

§

type Output = Runtime

The resulting type after applying the * operator.
source§

fn mul(self, other: &u32) -> Self

Performs the * operation. Read more
source§

impl Mul<Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the * operator.
source§

fn mul(self, other: Runtime) -> Self

Performs the * operation. Read more
source§

impl Mul<Runtime> for u32

§

type Output = u32

The resulting type after applying the * operator.
source§

fn mul(self, other: Runtime) -> Self

Performs the * operation. Read more
source§

impl Mul<u32> for Runtime

§

type Output = Runtime

The resulting type after applying the * operator.
source§

fn mul(self, other: u32) -> Self

Performs the * operation. Read more
source§

impl Ord for Runtime

source§

fn cmp(&self, other: &Runtime) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<&Runtime> for str

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<&Runtime> for u32

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<&str> for Runtime

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Runtime> for Runtime

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Runtime> for str

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Runtime> for u32

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<str> for Runtime

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u32> for &Runtime

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u32> for Runtime

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<&Runtime> for str

source§

fn partial_cmp(&self, other: &&Runtime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<&Runtime> for u32

source§

fn partial_cmp(&self, other: &&Runtime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<&str> for Runtime

source§

fn partial_cmp(&self, other: &&str) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<Runtime> for Runtime

source§

fn partial_cmp(&self, other: &Runtime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<Runtime> for str

source§

fn partial_cmp(&self, other: &Runtime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<Runtime> for u32

source§

fn partial_cmp(&self, other: &Runtime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<str> for Runtime

source§

fn partial_cmp(&self, other: &str) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u32> for &Runtime

source§

fn partial_cmp(&self, other: &u32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u32> for Runtime

source§

fn partial_cmp(&self, other: &u32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem<&Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the % operator.
source§

fn rem(self, other: &Runtime) -> Self

Performs the % operation. Read more
source§

impl Rem<&Runtime> for u32

§

type Output = u32

The resulting type after applying the % operator.
source§

fn rem(self, other: &Runtime) -> Self

Performs the % operation. Read more
source§

impl Rem<&u32> for Runtime

§

type Output = Runtime

The resulting type after applying the % operator.
source§

fn rem(self, other: &u32) -> Self

Performs the % operation. Read more
source§

impl Rem<Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the % operator.
source§

fn rem(self, other: Runtime) -> Self

Performs the % operation. Read more
source§

impl Rem<Runtime> for u32

§

type Output = u32

The resulting type after applying the % operator.
source§

fn rem(self, other: Runtime) -> Self

Performs the % operation. Read more
source§

impl Rem<u32> for Runtime

§

type Output = Runtime

The resulting type after applying the % operator.
source§

fn rem(self, other: u32) -> Self

Performs the % operation. Read more
source§

impl Serialize for Runtime

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 Sub<&Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the - operator.
source§

fn sub(self, other: &Runtime) -> Self

Performs the - operation. Read more
source§

impl Sub<&Runtime> for u32

§

type Output = u32

The resulting type after applying the - operator.
source§

fn sub(self, other: &Runtime) -> Self

Performs the - operation. Read more
source§

impl Sub<&u32> for Runtime

§

type Output = Runtime

The resulting type after applying the - operator.
source§

fn sub(self, other: &u32) -> Self

Performs the - operation. Read more
source§

impl Sub<Runtime> for Runtime

§

type Output = Runtime

The resulting type after applying the - operator.
source§

fn sub(self, other: Runtime) -> Self

Performs the - operation. Read more
source§

impl Sub<Runtime> for u32

§

type Output = u32

The resulting type after applying the - operator.
source§

fn sub(self, other: Runtime) -> Self

Performs the - operation. Read more
source§

impl Sub<u32> for Runtime

§

type Output = Runtime

The resulting type after applying the - operator.
source§

fn sub(self, other: u32) -> Self

Performs the - operation. Read more
source§

impl Copy for Runtime

source§

impl Eq for Runtime

source§

impl StructuralEq for Runtime

source§

impl StructuralPartialEq for Runtime

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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> ToCompactString for Twhere T: Display,

source§

fn to_compact_string(&self) -> CompactString

Converts the given value to a CompactString. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,