Struct ckb_occupied_capacity::Capacity
source · [−]pub struct Capacity(_);
Expand description
CKB capacity.
It is encoded as the amount of Shannons
internally.
Implementations
sourceimpl Capacity
impl Capacity
sourcepub fn safe_add<C>(self, rhs: C) -> Result<Capacity, Error> where
C: IntoCapacity,
pub fn safe_add<C>(self, rhs: C) -> Result<Capacity, Error> where
C: IntoCapacity,
Adds self and rhs and checks overflow error.
sourcepub fn safe_sub<C>(self, rhs: C) -> Result<Capacity, Error> where
C: IntoCapacity,
pub fn safe_sub<C>(self, rhs: C) -> Result<Capacity, Error> where
C: IntoCapacity,
Subtracts self and rhs and checks overflow error.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Capacity
impl<'de> Deserialize<'de> for Capacity
sourcepub fn deserialize<__D>(
__deserializer: __D
) -> Result<Capacity, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Capacity, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl IntoCapacity for Capacity
impl IntoCapacity for Capacity
sourcepub fn into_capacity(self) -> Capacity
pub fn into_capacity(self) -> Capacity
Converts self
into Capacity
.
sourceimpl Ord for Capacity
impl Ord for Capacity
sourceimpl PartialOrd<Capacity> for Capacity
impl PartialOrd<Capacity> for Capacity
sourcepub fn partial_cmp(&self, other: &Capacity) -> Option<Ordering>
pub fn partial_cmp(&self, other: &Capacity) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for Capacity
impl Serialize for Capacity
sourcepub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Capacity
impl Eq for Capacity
impl StructuralEq for Capacity
impl StructuralPartialEq for Capacity
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more