Checked

Struct Checked 

Source
pub struct Checked<T>(/* private fields */);
Expand description

Container for safe integers operators

let x = Checked::new(2_u32);

assert_eq!((x + 3).unwrap(), 5);
assert!(matches!((x + 4).check(), Ok(6)));
assert!((x + u32::MAX).is_err());

Implementations§

Source§

impl<T> Checked<T>

Source

pub fn new(val: T) -> Self

Source

pub fn check(self) -> Result<T, MathError>

Returns the result of the calculation

Source§

impl Checked<u8>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<u8>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<u8>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<u8>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<u8>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<u8>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<u8>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<u8>

Source

pub fn usize(self) -> Checked<usize>

Source§

impl Checked<u16>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<u16>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<u16>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<u16>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<u16>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<u16>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<u16>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<u16>

Source

pub fn usize(self) -> Checked<usize>

Source§

impl Checked<u32>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<u32>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<u32>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<u32>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<u32>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<u32>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<u32>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<u32>

Source

pub fn usize(self) -> Checked<usize>

Source§

impl Checked<u64>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<u64>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<u64>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<u64>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<u64>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<u64>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<u64>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<u64>

Source

pub fn usize(self) -> Checked<usize>

Source§

impl Checked<i16>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<i16>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<i16>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<i16>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<i16>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<i16>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<i16>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<i16>

Source

pub fn usize(self) -> Checked<usize>

Source§

impl Checked<i32>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<i32>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<i32>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<i32>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<i32>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<i32>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<i32>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<i32>

Source

pub fn usize(self) -> Checked<usize>

Source§

impl Checked<i64>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<i64>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<i64>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<i64>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<i64>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<i64>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<i64>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<i64>

Source

pub fn usize(self) -> Checked<usize>

Source§

impl Checked<usize>

Source

pub fn u8(self) -> Checked<u8>

Source§

impl Checked<usize>

Source

pub fn u16(self) -> Checked<u16>

Source§

impl Checked<usize>

Source

pub fn u32(self) -> Checked<u32>

Source§

impl Checked<usize>

Source

pub fn u64(self) -> Checked<u64>

Source§

impl Checked<usize>

Source

pub fn i16(self) -> Checked<i16>

Source§

impl Checked<usize>

Source

pub fn i32(self) -> Checked<i32>

Source§

impl Checked<usize>

Source

pub fn i64(self) -> Checked<i64>

Source§

impl Checked<usize>

Source

pub fn usize(self) -> Checked<usize>

Methods from Deref<Target = Result<T, MathError>>§

1.0.0 · Source

pub fn is_ok(&self) -> bool

Returns true if the result is Ok.

§Examples
let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_ok(), true);

let x: Result<i32, &str> = Err("Some error message");
assert_eq!(x.is_ok(), false);
1.0.0 · Source

pub fn is_err(&self) -> bool

Returns true if the result is Err.

§Examples
let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_err(), false);

let x: Result<i32, &str> = Err("Some error message");
assert_eq!(x.is_err(), true);
1.0.0 · Source

pub fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

Produces a new Result, containing a reference into the original, leaving the original in place.

§Examples
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.as_ref(), Ok(&2));

let x: Result<u32, &str> = Err("Error");
assert_eq!(x.as_ref(), Err(&"Error"));
1.47.0 · Source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>
where T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

Coerces the Ok variant of the original Result via Deref and returns the new Result.

§Examples
let x: Result<String, u32> = Ok("hello".to_string());
let y: Result<&str, &u32> = Ok("hello");
assert_eq!(x.as_deref(), y);

let x: Result<String, u32> = Err(42);
let y: Result<&str, &u32> = Err(&42);
assert_eq!(x.as_deref(), y);
1.0.0 · Source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

The iterator yields one value if the result is Result::Ok, otherwise none.

§Examples
let x: Result<u32, &str> = Ok(7);
assert_eq!(x.iter().next(), Some(&7));

let x: Result<u32, &str> = Err("nothing!");
assert_eq!(x.iter().next(), None);

Trait Implementations§

Source§

impl Add<Checked<i16>> for i16

Source§

type Output = Checked<i16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<i16>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Checked<i32>> for i32

Source§

type Output = Checked<i32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<i32>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Checked<i64>> for i64

Source§

type Output = Checked<i64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<i64>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Checked<u16>> for u16

Source§

type Output = Checked<u16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<u16>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Checked<u32>> for u32

Source§

type Output = Checked<u32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<u32>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Checked<u64>> for u64

Source§

type Output = Checked<u64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<u64>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Checked<u8>> for u8

Source§

type Output = Checked<u8>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<u8>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Checked<usize>> for usize

Source§

type Output = Checked<usize>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Checked<usize>) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<i16>

Source§

type Output = Checked<i16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<i32>

Source§

type Output = Checked<i32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<i64>

Source§

type Output = Checked<i64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<u16>

Source§

type Output = Checked<u16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<u32>

Source§

type Output = Checked<u32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<u64>

Source§

type Output = Checked<u64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<u8>

Source§

type Output = Checked<u8>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: Into<Self> + Copy> Add<R> for Checked<usize>

Source§

type Output = Checked<usize>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Clone> Clone for Checked<T>

Source§

fn clone(&self) -> Checked<T>

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<T: Debug> Debug for Checked<T>

Source§

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

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

impl<T> Deref for Checked<T>

Source§

type Target = Result<T, MathError>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Div<Checked<i16>> for i16

Source§

type Output = Checked<i16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<i16>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Checked<i32>> for i32

Source§

type Output = Checked<i32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<i32>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Checked<i64>> for i64

Source§

type Output = Checked<i64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<i64>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Checked<u16>> for u16

Source§

type Output = Checked<u16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<u16>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Checked<u32>> for u32

Source§

type Output = Checked<u32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<u32>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Checked<u64>> for u64

Source§

type Output = Checked<u64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<u64>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Checked<u8>> for u8

Source§

type Output = Checked<u8>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<u8>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Checked<usize>> for usize

Source§

type Output = Checked<usize>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Checked<usize>) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<i16>

Source§

type Output = Checked<i16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<i32>

Source§

type Output = Checked<i32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<i64>

Source§

type Output = Checked<i64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<u16>

Source§

type Output = Checked<u16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<u32>

Source§

type Output = Checked<u32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<u64>

Source§

type Output = Checked<u64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<u8>

Source§

type Output = Checked<u8>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: Into<Self> + Copy> Div<R> for Checked<usize>

Source§

type Output = Checked<usize>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<T> From<T> for Checked<T>

Source§

fn from(val: T) -> Self

Converts to this type from the input type.
Source§

impl Mul<Checked<i16>> for i16

Source§

type Output = Checked<i16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<i16>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Checked<i32>> for i32

Source§

type Output = Checked<i32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<i32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Checked<i64>> for i64

Source§

type Output = Checked<i64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<i64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Checked<u16>> for u16

Source§

type Output = Checked<u16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<u16>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Checked<u32>> for u32

Source§

type Output = Checked<u32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<u32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Checked<u64>> for u64

Source§

type Output = Checked<u64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<u64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Checked<u8>> for u8

Source§

type Output = Checked<u8>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<u8>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Checked<usize>> for usize

Source§

type Output = Checked<usize>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Checked<usize>) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<i16>

Source§

type Output = Checked<i16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<i32>

Source§

type Output = Checked<i32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<i64>

Source§

type Output = Checked<i64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<u16>

Source§

type Output = Checked<u16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<u32>

Source§

type Output = Checked<u32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<u64>

Source§

type Output = Checked<u64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<u8>

Source§

type Output = Checked<u8>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: Into<Self> + Copy> Mul<R> for Checked<usize>

Source§

type Output = Checked<usize>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl Sub<Checked<i16>> for i16

Source§

type Output = Checked<i16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<i16>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Checked<i32>> for i32

Source§

type Output = Checked<i32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<i32>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Checked<i64>> for i64

Source§

type Output = Checked<i64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<i64>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Checked<u16>> for u16

Source§

type Output = Checked<u16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<u16>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Checked<u32>> for u32

Source§

type Output = Checked<u32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<u32>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Checked<u64>> for u64

Source§

type Output = Checked<u64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<u64>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Checked<u8>> for u8

Source§

type Output = Checked<u8>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<u8>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Checked<usize>> for usize

Source§

type Output = Checked<usize>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Checked<usize>) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<i16>

Source§

type Output = Checked<i16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<i32>

Source§

type Output = Checked<i32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<i64>

Source§

type Output = Checked<i64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<u16>

Source§

type Output = Checked<u16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<u32>

Source§

type Output = Checked<u32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<u64>

Source§

type Output = Checked<u64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<u8>

Source§

type Output = Checked<u8>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: Into<Self> + Copy> Sub<R> for Checked<usize>

Source§

type Output = Checked<usize>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Copy> Copy for Checked<T>

Auto Trait Implementations§

§

impl<T> Freeze for Checked<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Checked<T>
where T: RefUnwindSafe,

§

impl<T> Send for Checked<T>
where T: Send,

§

impl<T> Sync for Checked<T>
where T: Sync,

§

impl<T> Unpin for Checked<T>
where T: Unpin,

§

impl<T> UnwindSafe for Checked<T>
where T: UnwindSafe,

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

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.