Skip to main content

QAdic

Struct QAdic 

Source
pub struct QAdic<A>
where A: AdicInteger,
{ /* private fields */ }
Expand description

Fractional adic number

The struct holds an adic integer and a valuation. Digitally, there are -valuation digits to the right of the decimal. With this, you can represent any adic number.

The adic integer is generic and so can be e.g.

let twenty_three_and_11_25 = QAdic::new(UAdic::new(5, vec![1, 2, 3, 4]), Valuation::Finite(-2));
assert_eq!("43.21_5", twenty_three_and_11_25.to_string());
let fifty = QAdic::new(UAdic::new(5, vec![0, 2]), 1);
assert_eq!("200._5", fifty.to_string());
let neg_one_tenth = QAdic::new(EAdic::new_repeating(5, vec![], vec![2]), -1);
assert_eq!("(2).2_5", neg_one_tenth.to_string());

assert_eq!(
    QAdic::new(UAdic::new(5, vec![1, 2, 4, 1, 1]), -2),
    QAdic::new(UAdic::new(5, vec![1, 2, 3, 4]), -2) + QAdic::new(UAdic::new(5, vec![1, 2]), 0)
);
assert_eq!(
    QAdic::new(UAdic::new(5, vec![2, 2]), -3),
    QAdic::new(UAdic::new(5, vec![3]), -2) * QAdic::new(UAdic::new(5, vec![4]), -1)
);

assert_eq!(Ratio::new(1, 1), QAdic::new(UAdic::new(5, vec![4, 1, 3, 2]), 0).norm());
assert_eq!(Ratio::new(1, 25), QAdic::new(UAdic::new(5, vec![4, 1, 3, 2]), 2).norm());
assert_eq!(Ratio::new(25, 1), QAdic::new(UAdic::new(5, vec![4, 1, 3, 2]), -2).norm());

This struct represents adic numbers as base-p digital expansions, with a possibly-infinite number of digits to the left of a decimal point and a finite number of digits to the right.

AdicIntegers are similar, but without digits to the right of the decimal. QAdics can represent all rational numbers as well as many irrational (distinct from the real number irrationals). Using the p-adic norm, these numbers have valuation -inf < v <= inf, i.e. |x| = p^(-v).

let neg_one = -EAdic::one(5);
let neg_one_fifth = QAdic::new(neg_one.clone(), -1);
let neg_one_twenty_fifth = QAdic::new(neg_one.clone(), -2);
let sqrt_neg_one = ZAdic::new_approx(5, 6, vec![2, 1, 2, 1, 3, 4]);
assert_eq!("...431212._5", sqrt_neg_one.to_string());
let sqrt_neg_one_twenty_fifth = QAdic::new(sqrt_neg_one.clone(), -1);
assert_eq!("...43121.2_5", sqrt_neg_one_twenty_fifth.to_string());
assert_eq!(
    Ok(Variety::new(vec![sqrt_neg_one.clone(), -sqrt_neg_one.clone()])),
    neg_one.nth_root(2, 6)
);
assert!(neg_one_fifth.nth_root(2, 5).is_ok_and(|variety| variety.is_empty()));
assert_eq!(
    Ok(Variety::new(vec![sqrt_neg_one_twenty_fifth.clone(), -sqrt_neg_one_twenty_fifth])),
    neg_one_twenty_fifth.nth_root(2, 5)
);

https://en.wikipedia.org/wiki/P-adic_number

§Panics

Many methods will panic if a provided prime p is not prime or digits are outside of [0, p).

Implementations§

Source§

impl<A> QAdic<A>
where A: AdicInteger,

Source

pub fn new<V>(adic_int: A, valuation: V) -> Self
where V: Into<Valuation<isize>>,

Create an adic number with the given digits and valuation

Source

pub fn frac_and_int(&self) -> (QAdic<UAdic>, A)

Split QAdic into fraction (as QAdic<UAdic>) and integer (as A)

let r = EAdic::new_repeating(7, vec![1, 2], vec![3, 4, 5]);
assert_eq!("(543)21._7", r.to_string());
let q = QAdic::new(r, -6);
assert_eq!("(354).354321_7", q.to_string());
let (q_frac, q_int) = q.frac_and_int();
assert_eq!("0.354321_7", q_frac.to_string());
assert_eq!("(354)._7", q_int.to_string());
Source

pub fn from_integer(adic_int: A) -> Self

Create an adic number with the given digits and zero valuation

Source

pub fn try_into_integer(self) -> AdicResult<A>

Try to convert into an AdicInteger, returning error if there are fractional digits

let r = EAdic::new_repeating(7, vec![1, 2], vec![3, 4, 5]);
assert_eq!("(543)21._7", r.to_string());
let q = QAdic::new(r.clone(), 3);
assert_eq!("(543)21000._7", q.to_string());
let q_int = q.try_into_integer();
assert_eq!(Ok("(543)21000._7".to_string()), q_int.map(|a| a.to_string()));
let q = QAdic::new(r, -3);
assert_eq!("(354).321_7", q.to_string());
let q_int = q.try_into_integer();
assert_eq!(Err(AdicError::AdicIntegerExpected), q_int);
Source

pub fn nth_root( &self, n: u32, precision: isize, ) -> AdicResult<Variety<QAdic<ZAdic>>>
where Self: Into<QAdic<ZAdic>>,

Calculate the n-th root, to precision digits, using Hensel lifting.

This is a specific case of Polynomial::variety, for the polynomial f(x) = x^n - a = 0.

If n has a factor of p, then the algorithm is more complicated because you have to take into account more digits.

7-adic sqrt(1/98) has two solutions, starting with 3 and with 4

let seven_adic_2_49 = QAdic::new(UAdic::new(7, vec![2]), -2);
let variety = seven_adic_2_49.nth_root(2, 6).unwrap();
let expected = Variety::new(vec![
    QAdic::new(ZAdic::new_approx(7, 7, vec![3, 1, 2, 6, 1, 2, 1]), -1),
    QAdic::new(ZAdic::new_approx(7, 7, vec![4, 5, 4, 0, 5, 4, 5]), -1),
]);
assert_eq!(expected, variety);
assert_eq!("variety(...121621.3_7, ...545045.4_7)", variety.to_string());
§Errors
  1. QAdic’s certainty is not high enough for desired precision
  2. n == 0
§Panics

Panics if certainty does not behave as expected

Source

pub fn num_nth_roots(&self, n: u32) -> AdicResult<usize>
where Self: Into<QAdic<ZAdic>>,

Return the number of n-th roots of this QAdic

let two_49ths = QAdic::<EAdic>::primed_from(7, Rational32::new(2, 49));
assert_eq!(Ok(0), two_49ths.num_nth_roots(0));
assert_eq!(Ok(1), two_49ths.num_nth_roots(1));
assert_eq!(Ok(2), two_49ths.num_nth_roots(2));
assert_eq!(Ok(0), two_49ths.num_nth_roots(3));
assert_eq!(Ok(0), two_49ths.num_nth_roots(4));
assert_eq!(Ok(0), two_49ths.num_nth_roots(5));
assert_eq!(Ok(0), two_49ths.num_nth_roots(6));
assert_eq!(Ok(0), two_49ths.num_nth_roots(7));
§Errors

Errors if rootfinding encounters problems, e.g. heavily degenerate roots

Source§

impl QAdic<ZAdic>

Source

pub fn empty<P, V>(p: P, v: V) -> Self
where P: Into<Prime>, V: Into<Valuation<isize>>,

Create the empty QAdic<ZAdic> with valuation v

Trait Implementations§

Source§

impl<A> Add for QAdic<A>
where A: AdicInteger,

Source§

type Output = QAdic<A>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<A> AddAssign for QAdic<A>
where A: AdicInteger,

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<A> AdicPrimitive for QAdic<A>
where A: AdicInteger,

Source§

fn zero<P>(p: P) -> Self
where P: Into<Prime>,

Create the zero adic number Read more
Source§

fn one<P>(p: P) -> Self
where P: Into<Prime>,

Create the one adic number Read more
Source§

fn p(&self) -> Prime

Prime for this adic
Source§

fn from_prime<P>(p: P) -> Self
where P: Into<Prime>,

Create the adic number associated with its prime Read more
Source§

fn from_prime_power<PP>(pp: PP) -> Self
where PP: Into<PrimePower>,

Create the adic number associated with a power of its prime Read more
Source§

impl<A> CanApproximate for QAdic<A>
where A: AdicInteger,

Source§

type Approximation = QAdic<ZAdic>

Output of the approximation
Source§

fn approximation(&self, n: isize) -> Self::Approximation

Approximate an number expansion to digit index n. See also: into_approximation Read more
Source§

fn into_approximation(self, n: isize) -> Self::Approximation

Consume and get the approximation to digit index n. See also: approximation Read more
Source§

impl<A> CanTruncate for QAdic<A>
where A: AdicInteger,

Source§

type Quotient = A

Output of quotient
Source§

type Truncation = QAdic<UAdic>

Output of truncation
Source§

fn split(&self, n: Self::DigitIndex) -> (Self::Truncation, Self::Quotient)

Split adic into digits [0, n) and [n, …). This splits the number into remainder and quotient. See also: into_split Read more
Source§

fn into_split(self, n: Self::DigitIndex) -> (Self::Truncation, Self::Quotient)

Split adic into digits [0, n) and [n, …). This splits the number into remainder and quotient. See also: split Read more
Source§

fn truncation(&self, n: Self::DigitIndex) -> Self::Truncation
where Self: Sized,

Truncate an adic number’s expansion to n. This can be thought of as the remainder a % p^n. See also: into_truncation Read more
Source§

fn into_truncation(self, n: Self::DigitIndex) -> Self::Truncation
where Self: Sized,

Truncate an adic number’s expansion to n. This can be thought of as the remainder a % p^n. See also: truncation Read more
Source§

fn quotient(&self, n: Self::DigitIndex) -> Self::Quotient
where Self: Sized,

Divide an adic number by p^n. This can be thought of as the quotient a // p^n See also: into_quotient Read more
Source§

fn into_quotient(self, n: Self::DigitIndex) -> Self::Quotient
where Self: Sized,

Divide an adic number by p^n. This can be thought of as the quotient a // p^n See also: quotient Read more
Source§

impl CheckedDiv for QAdic<EAdic>

Source§

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

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

impl CheckedDiv for QAdic<ZAdic>

Source§

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

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

impl<A> Clone for QAdic<A>
where A: AdicInteger + Clone,

Source§

fn clone(&self) -> QAdic<A>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<A> Debug for QAdic<A>
where A: AdicInteger + Debug,

Source§

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

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

impl<A> Display for QAdic<A>
where A: AdicInteger + HasDigitDisplay<DigitDisplay = String>,

Source§

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

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

impl Div for QAdic<EAdic>

Source§

type Output = QAdic<EAdic>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div for QAdic<ZAdic>

Source§

type Output = QAdic<ZAdic>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<A> Eq for QAdic<A>
where A: AdicInteger + Eq,

Source§

impl From<QAdic<EAdic>> for QAdic<ZAdic>

Source§

fn from(value: QAdic<EAdic>) -> Self

Converts to this type from the input type.
Source§

impl From<QAdic<IAdic>> for QAdic<ZAdic>

Source§

fn from(value: QAdic<IAdic>) -> Self

Converts to this type from the input type.
Source§

impl From<QAdic<RAdic>> for QAdic<ZAdic>

Source§

fn from(value: QAdic<RAdic>) -> Self

Converts to this type from the input type.
Source§

impl From<QAdic<UAdic>> for QAdic<ZAdic>

Source§

fn from(value: QAdic<UAdic>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<UAdic> for QAdic<A>
where A: AdicInteger,

Source§

fn from(value: UAdic) -> Self

Converts to this type from the input type.
Source§

impl<A> HasApproximateDigits for QAdic<A>
where A: AdicInteger,

Source§

fn certainty(&self) -> Valuation<isize>

The index of the first unknown digit for this number: v(...0021.30_5) = 4 Read more
Source§

fn has_no_certainty(&self) -> bool

The number is completely uncertain, has no known digits Read more
Source§

fn is_certain(&self) -> bool

The number is completely certain, has no unknown digits Read more
Source§

fn significance(&self) -> Valuation<Self::ValuationRing>
where Self: UltraNormed<ValuationRing = Self::DigitIndex>, Self::ValuationRing: Sub<Output = Self::ValuationRing>,

The digital distance between minimum index and maximum (certainty). Read more
Source§

impl<A> HasDigits for QAdic<A>
where A: AdicInteger,

Source§

type DigitIndex = isize

Type for the digits’ index, e.g. usize for EAdic or isize for QAdic
Source§

fn base(&self) -> Composite

Number of possibilities for digits Read more
Source§

fn min_index(&self) -> Valuation<Self::DigitIndex>

Minimum digit index, possibly zero for positive valuation numbers. This is the index where the first digit of [digits](Self::digits) starts. Read more
Source§

fn num_digits(&self) -> Valuation<usize>

The number of digits this number ultimately has, finite or infinite. Returns num-valuation if valuation is negative and num if it is positive. Read more
Source§

fn digit(&self, n: isize) -> AdicResult<u32>

Gets the digit at this coefficient of p^n; error if it is beyond known digits (certainty) Read more
Source§

fn digits(&self) -> impl Iterator<Item = u32>

Digits iterator for this object, starting from min_index Read more
Source§

fn has_finite_digits(&self) -> bool

Test if this has a finite number of digits Read more
Source§

fn digit0(&self) -> AdicResult<u32>

Returns the digit in the zeroth position or Err if it is beyond known digits (certainty) Read more
Source§

fn real_projection(&self) -> AdicResult<f64>

Flips the digit indices from positive to negative and returns the corresponding f64. E.g. if this is an adic number, it flips the digits around its decimal point and returns the value as a real number. Read more
Source§

impl<A> Hash for QAdic<A>
where A: AdicInteger + Hash,

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 Inv for QAdic<EAdic>

Source§

type Output = QAdic<EAdic>

The result after applying the operator.
Source§

fn inv(self) -> Self::Output

Returns the multiplicative inverse of self. Read more
Source§

impl Inv for QAdic<ZAdic>

Source§

type Output = QAdic<ZAdic>

The result after applying the operator.
Source§

fn inv(self) -> Self::Output

Returns the multiplicative inverse of self. Read more
Source§

impl<A> LocalOne for QAdic<A>
where A: AdicInteger,

Source§

fn local_one(&self) -> Self

Returns a one local to self
Source§

fn is_local_one(&self) -> bool

Checks whether or not self is equivalent to its local one
Source§

fn set_local_one(&mut self)

Sets the object equal to its local one
Source§

impl<A> LocalZero for QAdic<A>
where A: AdicInteger,

Source§

fn local_zero(&self) -> Self

Returns a zero local to self
Source§

fn is_local_zero(&self) -> bool

Checks whether or not self is equivalent to its local zero
Source§

fn set_local_zero(&mut self)

Sets the object equal to its local zero
Source§

impl<A> Mul for QAdic<A>
where A: AdicInteger,

Source§

type Output = QAdic<A>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<A> Mul<QAdic<A>> for u32
where A: AdicInteger,

Source§

type Output = QAdic<A>

The resulting type after applying the * operator.
Source§

fn mul(self, adic_int: QAdic<A>) -> QAdic<A>

Performs the * operation. Read more
Source§

impl<A> MulAssign for QAdic<A>
where A: AdicInteger,

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<A> Neg for QAdic<A>
where A: AdicInteger + Neg<Output = A>,

Source§

type Output = QAdic<A>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<A> Normed for QAdic<A>
where A: AdicInteger,

Source§

type Norm = Ratio<u32>

Type for the number’s norm
Source§

type Unit = A

Type for the number’s unit
Source§

fn norm(&self) -> Ratio<u32>

Norm of the number, the “size”
Source§

fn unit(&self) -> Option<Self::Unit>

Unit component of the number, or None if Zero
Source§

fn into_unit(self) -> Option<Self::Unit>

Unit component of the number, or None if Zero
Source§

fn from_norm_and_unit(norm: Self::Norm, u: Self::Unit) -> Self

Create with given norm and unit
Source§

fn from_unit(u: Self::Unit) -> Self

Create from a unit
Source§

fn is_unit(&self) -> bool

Test if the number is a unit Read more
Source§

impl<A> PartialEq for QAdic<A>

Source§

fn eq(&self, other: &QAdic<A>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<A> Pow<u32> for QAdic<A>
where A: AdicInteger,

Source§

type Output = QAdic<A>

The result after applying the operator.
Source§

fn pow(self, power: u32) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T> PrimedFrom<Ratio<BigInt>> for QAdic<T>
where T: AdicInteger, Self: From<QAdic<EAdic>>,

Source§

fn primed_from<P>(p: P, n: BigRational) -> Self
where P: Into<Prime>,

Convert from N to Self with Prime p Read more
Source§

impl<T> PrimedFrom<Ratio<i32>> for QAdic<T>
where T: AdicInteger, Self: From<QAdic<EAdic>>,

Source§

fn primed_from<P>(p: P, n: Rational32) -> Self
where P: Into<Prime>,

Convert from N to Self with Prime p Read more
Source§

impl<A> StructuralPartialEq for QAdic<A>

Source§

impl<A> Sub for QAdic<A>
where A: AdicInteger + Neg<Output = A>,

Source§

type Output = QAdic<A>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<A> SubAssign for QAdic<A>
where A: AdicInteger + Neg<Output = A>,

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<A> UltraNormed for QAdic<A>
where A: AdicInteger,

Source§

type ValuationRing = isize

Type for the valuation, e.g. the type of v in a/b p^v
Source§

fn from_unit_and_valuation( u: Self::Unit, v: Valuation<Self::ValuationRing>, ) -> Self

Create with the given unit and valuation
Source§

fn valuation(&self) -> Valuation<isize>

The adic valuation for this number: v(a/b p^v) = v Read more
Source§

fn unit_and_valuation( &self, ) -> (Option<Self::Unit>, Valuation<Self::ValuationRing>)

Transform into the adic unit and valuation form; transforms zero into (None, PosInf) Read more
Source§

fn into_unit_and_valuation( self, ) -> (Option<Self::Unit>, Valuation<Self::ValuationRing>)
where Self: Sized,

Transform into the adic unit and valuation form; transforms zero into (None, PosInf) Read more

Auto Trait Implementations§

§

impl<A> Freeze for QAdic<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for QAdic<A>
where A: RefUnwindSafe,

§

impl<A> Send for QAdic<A>
where A: Send,

§

impl<A> Sync for QAdic<A>
where A: Sync,

§

impl<A> Unpin for QAdic<A>
where A: Unpin,

§

impl<A> UnsafeUnpin for QAdic<A>
where A: UnsafeUnpin,

§

impl<A> UnwindSafe for QAdic<A>
where A: 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> PrimedFrom<BigInt> for T
where T: Neg<Output = T> + Sub<Output = T> + PrimedFrom<BigUint>,

Source§

fn primed_from<P>(p: P, n: BigInt) -> T
where P: Into<Prime>,

Convert from N to Self with Prime p Read more
Source§

impl<T> PrimedFrom<BigUint> for T
where T: AdicPrimitive,

Source§

fn primed_from<P>(p: P, n: BigUint) -> T
where P: Into<Prime>,

Convert from N to Self with Prime p Read more
Source§

impl<T> PrimedFrom<i32> for T
where T: Neg<Output = T> + Sub<Output = T> + PrimedFrom<u32>,

Source§

fn primed_from<P>(p: P, n: i32) -> T
where P: Into<Prime>,

Convert from N to Self with Prime p Read more
Source§

impl<T> PrimedFrom<u32> for T
where T: AdicPrimitive,

Source§

fn primed_from<P>(p: P, n: u32) -> T
where P: Into<Prime>,

Convert from N to Self with Prime p Read more
Source§

impl<A, N> PrimedInto<A> for N
where A: PrimedFrom<N>,

Source§

fn primed_into<P>(self, p: P) -> A
where P: Into<Prime>,

Convert from Self to A with Prime p 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<A, N> TryPrimedFrom<N> for A
where A: PrimedFrom<N>,

Source§

type Error = !

The type returned in the event of a conversion error
Source§

fn try_primed_from<P>(p: P, n: N) -> Result<A, <A as TryPrimedFrom<N>>::Error>
where P: Into<Prime>,

Convert from N to Self with Prime p Read more
Source§

impl<A, N> TryPrimedInto<A> for N
where A: TryPrimedFrom<N>,

Source§

type Error = <A as TryPrimedFrom<N>>::Error

The type returned in the event of a conversion error
Source§

fn try_primed_into<P>(self, p: P) -> Result<A, <N as TryPrimedInto<A>>::Error>
where P: Into<Prime>,

Convert from Self to A with Prime p Read more