Struct ckb_types::packed::CellOutput
source · [−]pub struct CellOutput(_);
Implementations
sourceimpl CellOutput
impl CellOutput
pub const FIELD_COUNT: usize = 3usize
pub fn total_size(&self) -> usize
pub fn field_count(&self) -> usize
pub fn count_extra_fields(&self) -> usize
pub fn has_extra_fields(&self) -> bool
pub fn capacity(&self) -> Uint64
pub fn lock(&self) -> Script
pub fn type_(&self) -> ScriptOpt
pub fn as_reader<'r>(&'r self) -> CellOutputReader<'r>
sourceimpl CellOutput
impl CellOutput
sourcepub fn calc_data_hash(data: &[u8]) -> Byte32
pub fn calc_data_hash(data: &[u8]) -> Byte32
Calculates the hash for cell data.
Returns the empty hash if no data, otherwise, calculates the hash of the data and returns it.
sourceimpl CellOutput
impl CellOutput
sourcepub fn calc_lock_hash(&self) -> Byte32
pub fn calc_lock_hash(&self) -> Byte32
sourceimpl CellOutput
impl CellOutput
sourcepub fn occupied_capacity(
&self,
data_capacity: Capacity
) -> CapacityResult<Capacity>
pub fn occupied_capacity(
&self,
data_capacity: Capacity
) -> CapacityResult<Capacity>
Calculates the occupied capacity of CellOutput
.
Includes output_data
(provided), capacity
(8), lock
(calculated) and type
(calculated).
sourcepub fn is_lack_of_capacity(
&self,
data_capacity: Capacity
) -> CapacityResult<bool>
pub fn is_lack_of_capacity(
&self,
data_capacity: Capacity
) -> CapacityResult<bool>
Returns if the capacity
in CellOutput
is smaller than the occupied capacity
.
Trait Implementations
sourceimpl Clone for CellOutput
impl Clone for CellOutput
sourcefn clone(&self) -> CellOutput
fn clone(&self) -> CellOutput
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CellOutput
impl Debug for CellOutput
sourceimpl Default for CellOutput
impl Default for CellOutput
sourceimpl Display for CellOutput
impl Display for CellOutput
sourceimpl Entity for CellOutput
impl Entity for CellOutput
type Builder = CellOutputBuilder
const NAME: &'static str = "CellOutput"
fn new_unchecked(data: Bytes) -> Self
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn from_slice(slice: &[u8]) -> VerificationResult<Self>
fn from_compatible_slice(slice: &[u8]) -> VerificationResult<Self>
fn new_builder() -> Self::Builder
fn as_builder(self) -> Self::Builder
sourceimpl Hash for CellOutput
impl Hash for CellOutput
sourceimpl LowerHex for CellOutput
impl LowerHex for CellOutput
sourceimpl PartialEq<CellOutput> for CellOutput
impl PartialEq<CellOutput> for CellOutput
impl Eq for CellOutput
Auto Trait Implementations
impl RefUnwindSafe for CellOutput
impl Send for CellOutput
impl Sync for CellOutput
impl Unpin for CellOutput
impl UnwindSafe for CellOutput
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> PackVec<CellOutputVec, CellOutput> for T where
T: IntoIterator<Item = CellOutput>,
impl<T> PackVec<CellOutputVec, CellOutput> for T where
T: IntoIterator<Item = CellOutput>,
sourcefn pack(self) -> CellOutputVec
fn pack(self) -> CellOutputVec
Packs a vector of binary data into one binary data.