[−][src]Struct ckb_occupied_capacity::Capacity
CKB capacity.
It is encoded as the amount of Shannons
internally.
Implementations
impl Capacity
[src]
pub const fn zero() -> Capacity
[src]
Capacity of zero Shannons.
pub const fn one() -> Capacity
[src]
Capacity of one Shannon.
pub const fn shannons(val: u64) -> Capacity
[src]
Views the capacity as Shannons.
pub fn bytes(val: usize) -> Result<Capacity, Error>
[src]
Views the capacity as CKBytes.
pub fn as_u64(self) -> u64
[src]
Views the capacity as Shannons.
pub fn safe_add<C>(self, rhs: C) -> Result<Capacity, Error> where
C: AsCapacity,
[src]
C: AsCapacity,
Adds self and rhs and checks overflow error.
pub fn safe_sub<C>(self, rhs: C) -> Result<Capacity, Error> where
C: AsCapacity,
[src]
C: AsCapacity,
Subtracts self and rhs and checks overflow error.
pub fn safe_mul<C>(self, rhs: C) -> Result<Capacity, Error> where
C: AsCapacity,
[src]
C: AsCapacity,
Multiplies self and rhs and checks overflow error.
pub fn safe_mul_ratio(self, ratio: Ratio) -> Result<Capacity, Error>
[src]
Multiplies self with a ratio and checks overflow error.
Trait Implementations
impl AsCapacity for Capacity
[src]
pub fn as_capacity(self) -> Capacity
[src]
impl Clone for Capacity
[src]
impl Copy for Capacity
[src]
impl Debug for Capacity
[src]
impl Default for Capacity
[src]
impl<'de> Deserialize<'de> for Capacity
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Capacity, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Capacity, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Display for Capacity
[src]
impl Eq for Capacity
[src]
impl FromStr for Capacity
[src]
type Err = ParseIntError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Capacity, <Capacity as FromStr>::Err>
[src]
impl Hash for Capacity
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl LowerHex for Capacity
[src]
impl Ord for Capacity
[src]
pub fn cmp(&self, other: &Capacity) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Capacity> for Capacity
[src]
impl PartialOrd<Capacity> for Capacity
[src]
pub fn partial_cmp(&self, other: &Capacity) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Capacity) -> bool
[src]
pub fn le(&self, other: &Capacity) -> bool
[src]
pub fn gt(&self, other: &Capacity) -> bool
[src]
pub fn ge(&self, other: &Capacity) -> bool
[src]
impl Serialize for Capacity
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralEq for Capacity
[src]
impl StructuralPartialEq for Capacity
[src]
Auto Trait Implementations
impl RefUnwindSafe for Capacity
impl Send for Capacity
impl Sync for Capacity
impl Unpin for Capacity
impl UnwindSafe for Capacity
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,