Struct Poly

Source
pub struct Poly<T: RealScalar>(/* private fields */);

Implementations§

Source§

impl<T: RealScalar> Poly<T>

Source

pub fn diff(self) -> Self

Derivative

§Panics

On very large degree polynomials coefficients may overflow in T

Source

pub fn integral(self) -> Self

Antiderivative (with C=0)

§Panics

On very large degree polynomials coefficients may overflow in T

Source§

impl<T: RealScalar> Poly<T>

Source

pub fn as_slice(&self) -> &[Complex<T>]

Source

pub fn as_mut_slice(&mut self) -> &mut [Complex<T>]

Source

pub fn as_ptr(&self) -> *const Complex<T>

Source

pub fn as_mut_ptr(&mut self) -> *mut Complex<T>

Source

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

Iterate over coefficients, from the least significant

Source

pub fn iter_mut(&mut self) -> IterMut<'_, Complex<T>>

Iterate over coefficients, from the least significant

Source

pub fn to_vec(&self) -> Vec<Complex<T>>

Source

pub fn from_complex_slice(value: &[Complex<T>]) -> Self

The same as Poly::new()

Source

pub fn from_complex_vec(value: Vec<Complex<T>>) -> Self

Source

pub fn from_real_slice(value: &[T]) -> Self

Source

pub fn from_real_vec(value: Vec<T>) -> Self

Source

pub fn from_real_iterator(coeffs: impl Iterator<Item = T>) -> Self

Source

pub fn from_complex_iterator(coeffs: impl Iterator<Item = Complex<T>>) -> Self

Source§

impl<T: RealScalar> Poly<T>

Source

pub fn div_rem(self, other: &Self) -> Option<(Self, Self)>

Calculate the quotient and remainder using long division. More efficient than calculating them separately.

§Panics

Panics if a division by zero is attempted

§Examples
use rust_poly::{Poly, poly};
use num::{Complex, One};

let c1 = poly![1.0, 2.0, 3.0];
let c2 = poly![3.0, 2.0, 1.0];
let expected1 = (poly![3.0], poly![-8.0, -4.0]);
assert_eq!(c1.clone().div_rem(&c2).unwrap(), expected1);
Source§

impl<T: RealScalar> Poly<T>

Source

pub fn coeffs(&self) -> &[Complex<T>]

Return a slice containing the coefficients in ascending order of degree

This is an alias for Poly::as_slice for API consistency.

Source

pub fn coeffs_mut(&mut self) -> &mut [Complex<T>]

Return a mutable slice containing the coefficient in ascending order of degree

This is an alias for Poly::as_mut_slice() for API consistency.

Source§

impl<T: RealScalar> Poly<T>

Source

pub fn roots(&self, epsilon: T, max_iter: usize) -> Result<T>

A convenient way of finding roots, with a pre-configured root finder. Should work well for most real polynomials of low degree.

Use Poly::roots_expert if you need more control over performance or accuracy.

§Errors
  • Solver did not converge within max_iter iterations
  • Some other edge-case was encountered which could not be handled (please report this, as we can make this solver more robust!)
Source

pub fn roots_expert( &self, epsilon: T, max_iter: usize, _min_iter: usize, polishing_mode: PolishingMode<T>, multiples_handling_mode: MultiplesHandlingMode<T>, initial_guess_pool: &[Complex<T>], initial_guess_mode: InitialGuessMode<T>, ) -> Result<T>

Highly configurable root finder.

Poly::roots will often be good enough, but you may know something about the polynomial you are factoring that allows you to tweak the settings.

§Errors
  • Solver did not converge within max_iter iterations
  • Some other edge-case was encountered which could not be handled (please report this, as we can make this solver more robust!)
  • The combination of parameters that was provided is invalid
Source§

impl<T: RealScalar + FromPrimitive> Poly<T>

Source

pub fn cheby(n: usize) -> Self

👎Deprecated: use cheby1 instead
Source

pub fn cheby1(n: usize) -> Self

Get the nth Chebyshev polynomial of the first kind.

use rust_poly::{poly, Poly};

assert_eq!(Poly::cheby(2), poly![-1.0, 0.0, 2.0]);
assert_eq!(Poly::cheby(3), poly![0.0, -3.0, 0.0, 4.0]);
assert_eq!(Poly::cheby(4), poly![1.0, 0.0, -8.0, 0.0, 8.0])
Source

pub fn bessel(n: usize) -> Option<Self>

Get the nth Bessel polynomial

Source

pub fn reverse_bessel(n: usize) -> Option<Self>

Source§

impl<T: RealScalar> Poly<T>

Source

pub fn legendre(n: usize) -> Self

Source§

impl<T: RealScalar> Poly<T>

Source

pub fn shift_up(&self, n: usize) -> Self

§Examples
let p = poly![1.0, 2.0, 3.0];
assert_eq!(p.shift_up(2), poly![0.0, 0.0, 1.0, 2.0, 3.0]);
Source

pub fn shift_down(&self, n: usize) -> Self

§Examples
let p = poly![1.0, 2.0, 3.0, 4.0];
assert_eq!(p.shift_down(2), poly![3.0, 4.0]);
Source§

impl<T: RealScalar> Poly<T>

Source

pub fn new(coeffs: &[Complex<T>]) -> Self

Source

pub fn constant(c: Complex<T>) -> Self

Complex constant as a polynomial of degree zero

Source

pub fn line(offset: Complex<T>, slope: Complex<T>) -> Self

Linear function as a polynomial.

§Examples
use rust_poly::Poly;
use num::Complex;
use num::{One, Zero};

assert_eq!(Poly::line(Complex::one(), Complex::new(-1.0, 0.0)).eval_point(Complex::one()), Complex::zero());
Source

pub fn line_from_points( p1: (Complex<T>, Complex<T>), p2: (Complex<T>, Complex<T>), ) -> Self

Line between two points with complex coordinates.

Note that the points are determined by two complex numbers, so they are in a four dimensional space. Leave the imaginary component as zero for lines in a 2D plane.

§Examples
use rust_poly::Poly;
use num::Complex;
use num::{One, Zero};

let p1 = (Complex::new(-1.0, 0.0), Complex::new(2.0, 0.0));
let p2 = (Complex::new(2.0, 0.0), Complex::new(-1.0, 0.0));

assert_eq!(Poly::line_from_points(p1, p2).eval_point(Complex::one()), Complex::zero());
Source

pub fn term(coeff: Complex<T>, degree: u32) -> Self

Create a polynomial from a single term (coefficient + degree)

§Examples
use rust_poly::{poly, Poly};
use num::Complex;
use num::One;

assert_eq!(Poly::term(Complex::one(), 3), poly![0.0, 0.0, 0.0, 1.0]);
Source

pub fn len(&self) -> usize

Source

pub fn degree_usize(&self) -> usize

Return the degree as usize.

Note that unlike Poly::degree, this will saturate at 0 for zero polynomials. As the degree of zero polynomials is undefined.

Source

pub fn degree(&self) -> i64

The degree of a polynomial (the maximum exponent)

Note that this will return -1 for zero polynomials. The degree of zero polynomials is undefined, but we use the -1 convention adopted by some authors.

§Panics

May theoretically panic for absurdly large polynomials, however such polynomials will likely not fit in memory anyway.\n\n

Source

pub fn is_empty(&self) -> bool

Source

pub fn pow(self, pow: u32) -> Self

Raises a polynomial to an integer power.

§Caveats

We adopt the convention that $0^0=1$, even though some authors leave this case undefined. We believe this to be more useful as it naturally arises in integer exponentiation when defined as repeated multiplication (as we implement it).

use rust_poly::{poly, Poly};
use num::Complex;

assert_eq!(poly![1.0, 2.0, 3.0].pow(2), poly![1.0, 4.0, 10.0, 12.0, 9.0]);
Source

pub fn pow_usize(self, pow: usize) -> Self

Same as Poly::pow, but takes a usize exponent.

Source

pub fn conj(&self) -> Self

Compute the conjugate polynomial, that is a polynomial where every coefficient is conjugated.

To evaluate a conjugate polynomial, you must evaluate it at the conjugate of the input, i.e. poly.conj().eval(z.conj())

Source

pub fn get_term(&self, degree: u32) -> Option<Self>

Get the nth term of the polynomial as a new polynomial

Will return None if out of bounds.

§Examples
use rust_poly::{poly, Poly};
use num::Complex;
use num::One;

let p  = poly![1.0, 2.0, 3.0];
assert_eq!(p.get_term(1).unwrap(), poly![0.0, 2.0]);
Source

pub fn terms(&self) -> Map<Range<usize>, impl FnMut(usize) -> Self + '_>

Iterate over the terms of a polynomial


let p = poly![1.0, 2.0, 3.0];
assert_eq!(p, p.terms().sum::<Poly<_>>());
§Panics

On polynomials with a degree higher than u32::MAX

Source§

impl<T: RealScalar + PartialOrd> Poly<T>

Source

pub fn from_roots(roots: &[Complex<T>]) -> Self

Monic polynomial from its complex roots.

§Examples
use rust_poly::Poly;
use num::Complex;
use num::{Zero, One};

let p = Poly::from_roots(&[Complex::new(-1.0, 0.0), Complex::zero(), Complex::one()]);
assert_eq!(p, Poly::new(&[Complex::zero(), Complex::new(-1.0, 0.0), Complex::zero(), Complex::one()]))
Source

pub fn compose(self, x: Self) -> Self

Compose two polynomials, returning a new polynomial.

Substitute the given polynomial x into self and expand the result into a new polynomial.

§Examples
use rust_poly::{Poly, poly};
use num::{One, Complex};

let f = poly![1.0, 2.0];
let g = Poly::one();

assert_eq!(f.clone().compose(g), f);
Source§

impl<T: RealScalar> Poly<T>

Source

pub fn eval_multiple(&self, points: &[Complex<T>], out: &mut [Complex<T>])

Evaluate the polynomial for each entry of a slice.

Source

pub fn eval(&self, x: Complex<T>) -> Complex<T>

Evaluate the polynomial at a single value of x.

use rust_poly::Poly;
use num::Complex;

let p = Poly::new(&[Complex::new(1.0, 0.0), Complex::new(2.0, 0.0), Complex::new(3.0, 0.0)]);
let x = Complex::new(1.0, 0.0);
assert_eq!(p.eval_point(x), Complex::new(6.0, 0.0));
Source§

impl<T: RealScalar + PartialOrd> Poly<T>

Source

pub fn translate(self, x: Complex<T>, y: Complex<T>) -> Self

Translate along x-axis (or x-plane) and y-axis (or y-plane).

Using complex coordinates means you’ll effectively be translating in 4D space.

Source§

impl<T: RealScalar> Poly<T>

Source

pub fn almost_zero(&self, tolerance: &T) -> bool

Returns true if every coefficient in the polynomial is smaller than the tolerance (using complex norm).

§Examples
use rust_poly::{Poly, poly};

assert!(poly![0.01, -0.01].almost_zero(&0.1));

Trait Implementations§

Source§

impl<T: RealScalar> Add<&Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Poly<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: RealScalar> Add<&Poly<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: RealScalar> Add<Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Poly<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: RealScalar> Add for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: RealScalar> CheckedDiv for Poly<T>

Source§

fn checked_div(&self, rhs: &Self) -> Option<Self>

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned.
Source§

impl<T: RealScalar> CheckedRem for Poly<T>

Source§

fn checked_rem(&self, rhs: &Self) -> Option<Self>

Finds the remainder of dividing two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned. Read more
Source§

impl<T: Clone + RealScalar> Clone for Poly<T>

Source§

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

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<T: Debug + RealScalar> Debug for Poly<T>

Source§

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

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

impl<T: RealScalar + Display> Display for Poly<T>

Source§

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

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

impl<T: RealScalar> Div<&Complex<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Complex<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: RealScalar> Div<&Complex<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Complex<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: RealScalar> Div<&Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Poly<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: RealScalar> Div<&Poly<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T: RealScalar> Div<Complex<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Complex<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: RealScalar> Div<Complex<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Complex<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: RealScalar> Div<Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Poly<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: RealScalar> Div for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T: RealScalar> From<&[Complex<T>]> for Poly<T>

Source§

fn from(value: &[Complex<T>]) -> Self

Converts to this type from the input type.
Source§

impl<T: RealScalar> From<Poly<T>> for *const Complex<T>

Source§

fn from(val: Poly<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: RealScalar> From<Poly<T>> for *mut Complex<T>

Source§

fn from(val: Poly<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: RealScalar> From<Poly<T>> for Vec<Complex<T>>

Source§

fn from(val: Poly<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: RealScalar> From<Vec<Complex<T>>> for Poly<T>

Source§

fn from(value: Vec<Complex<T>>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: RealScalar> IntoIterator for &'a Poly<T>

Source§

type IntoIter = Iter<'a, Complex<T>>

Which kind of iterator are we turning this into?
Source§

type Item = &'a Complex<T>

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T: RealScalar> IntoIterator for &'a mut Poly<T>

Source§

type IntoIter = IterMut<'a, Complex<T>>

Which kind of iterator are we turning this into?
Source§

type Item = &'a mut Complex<T>

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T: RealScalar> Mul<&Complex<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Complex<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: RealScalar> Mul<&Complex<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Complex<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: RealScalar> Mul<&Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Poly<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: RealScalar> Mul<&Poly<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: RealScalar> Mul<Complex<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: RealScalar> Mul<Complex<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: RealScalar> Mul<Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Poly<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: RealScalar> Mul for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: RealScalar> Neg for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: RealScalar> Neg for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: RealScalar> One for Poly<T>

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl<T: PartialEq + RealScalar> PartialEq for Poly<T>

Source§

fn eq(&self, other: &Poly<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: RealScalar> Rem<&Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Poly<T>) -> Self::Output

Performs the % operation. Read more
Source§

impl<T: RealScalar> Rem<&Poly<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<T: RealScalar> Rem<Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Poly<T>) -> Self::Output

Performs the % operation. Read more
Source§

impl<T: RealScalar> Rem for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<T: RealScalar> Sub<&Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Poly<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: RealScalar> Sub<&Poly<T>> for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: RealScalar> Sub<Poly<T>> for &Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Poly<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: RealScalar> Sub for Poly<T>

Source§

type Output = Poly<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: RealScalar> Sum for Poly<T>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<T: RealScalar> Zero for Poly<T>

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<T: Eq + RealScalar> Eq for Poly<T>

Source§

impl<T: RealScalar> StructuralPartialEq for Poly<T>

Auto Trait Implementations§

§

impl<T> Freeze for Poly<T>

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Poly<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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,