[−][src]Struct stellar_base::amount::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.
pub fn from_str(s: &str) -> Result<Price>
[src]
impl Ord for Price
[src]
pub fn cmp(&self, other: &Price) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Price> for Price
[src]
impl PartialOrd<Price> for Price
[src]
pub fn partial_cmp(&self, other: &Price) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Price) -> bool
[src]
pub fn le(&self, other: &Price) -> bool
[src]
pub fn gt(&self, other: &Price) -> bool
[src]
pub fn ge(&self, other: &Price) -> bool
[src]
impl StructuralEq for Price
[src]
impl StructuralPartialEq for Price
[src]
impl XDRDeserialize for Price
[src]
pub fn from_xdr_bytes(buffer: &[u8]) -> Result<(Self, u64)>
[src]
pub fn from_xdr_base64(encoded: &str) -> Result<Self>
[src]
impl XDRSerialize for Price
[src]
Auto Trait Implementations
impl RefUnwindSafe for Price
[src]
impl Send for Price
[src]
impl Sync for Price
[src]
impl Unpin for Price
[src]
impl UnwindSafe for Price
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,