pub struct CellOutput(/* private fields */);
Implementations§
Source§impl 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.
Source§impl CellOutput
impl CellOutput
Sourcepub fn calc_lock_hash(&self) -> Byte32
pub fn calc_lock_hash(&self) -> Byte32
Source§impl 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
.
Source§impl 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>
Trait Implementations§
Source§impl Clone for CellOutput
impl Clone for CellOutput
Source§fn clone(&self) -> CellOutput
fn clone(&self) -> CellOutput
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CellOutput
impl Debug for CellOutput
Source§impl Default for CellOutput
impl Default for CellOutput
Source§impl Display for CellOutput
impl Display for CellOutput
Source§impl Entity for CellOutput
impl Entity for CellOutput
const NAME: &'static str = "CellOutput"
type Builder = CellOutputBuilder
fn new_unchecked(data: Bytes) -> Self
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[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
Source§impl Hash for CellOutput
impl Hash for CellOutput
Source§impl LowerHex for CellOutput
impl LowerHex for CellOutput
Source§impl Ord for CellOutput
impl Ord for CellOutput
Source§impl PartialEq for CellOutput
impl PartialEq for CellOutput
Source§impl PartialOrd for CellOutput
impl PartialOrd for CellOutput
impl Eq for CellOutput
Auto Trait Implementations§
impl !Freeze for CellOutput
impl RefUnwindSafe for CellOutput
impl Send for CellOutput
impl Sync for CellOutput
impl Unpin for CellOutput
impl UnwindSafe for CellOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> PackVec<CellOutputVec, CellOutput> for Twhere
T: IntoIterator<Item = CellOutput>,
impl<T> PackVec<CellOutputVec, CellOutput> for Twhere
T: IntoIterator<Item = CellOutput>,
Source§fn pack(self) -> CellOutputVec
fn pack(self) -> CellOutputVec
Packs a vector of binary data into one binary data.