[][src]Struct stellar_base::amount::Price

pub struct Price(_);

Price in fractional representation.

Implementations

impl Price[src]

pub fn new(numerator: i32, denominator: i32) -> Price[src]

Creates price from numerator and denominator.

pub fn numerator(&self) -> i32[src]

Retrievs the price numerator.

pub fn denominator(&self) -> i32[src]

Retries the price denominator.

pub fn reduced(&self) -> Price[src]

Returns a reduced copy.

pub fn to_xdr(&self) -> Result<Price>[src]

Returns price as xdr object.

pub fn from_xdr(x: &Price) -> Result<Price>[src]

Creates price from xdr object.

Trait Implementations

impl Clone for Price[src]

impl Debug for Price[src]

impl Eq for Price[src]

impl FromStr for Price[src]

type Err = Error

The associated error which can be returned from parsing.

impl Ord for Price[src]

impl PartialEq<Price> for Price[src]

impl PartialOrd<Price> for Price[src]

impl StructuralEq for Price[src]

impl StructuralPartialEq for Price[src]

impl XDRDeserialize for Price[src]

impl XDRSerialize for Price[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.