pub struct OutPoint(_);Implementations
sourceimpl OutPoint
impl OutPoint
pub const TOTAL_SIZE: usize
pub const FIELD_SIZES: [usize; 2]
pub const FIELD_COUNT: usize
pub fn tx_hash(&self) -> Byte32
pub fn index(&self) -> Uint32
pub fn as_reader<'r>(&'r self) -> OutPointReader<'r>
sourceimpl OutPoint
impl OutPoint
sourcepub fn to_cell_key(&self) -> Vec<u8>
pub fn to_cell_key(&self) -> Vec<u8>
Generates a binary data to be used as a key for indexing cells in storage.
Notice
The difference between Self::as_slice()
and Self::to_cell_key() is the byteorder of the field index.
-
Uses little endian for the field
indexin serialization.Because in the real world, the little endian machines make up the majority, we can cast it as a number without re-order the bytes.
-
Uses big endian for the field
indexto index cells in storage.So we can use
tx_hashas key prefix to seek the cells from storage in the forward order, so as to traverse cells in the forward order too.
Trait Implementations
sourceimpl Entity for OutPoint
impl Entity for OutPoint
type Builder = OutPointBuilder
const NAME: &'static str
fn new_unchecked(data: Bytes) -> Self
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [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<T> PackVec<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
impl<T> PackVec<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
sourcefn pack(self) -> OutPointVec
fn pack(self) -> OutPointVec
Packs a vector of binary data into one binary data.
impl Eq for OutPoint
Auto Trait Implementations
impl RefUnwindSafe for OutPoint
impl Send for OutPoint
impl Sync for OutPoint
impl Unpin for OutPoint
impl UnwindSafe for OutPoint
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<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
impl<T> PackVec<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
sourcefn pack(self) -> OutPointVec
fn pack(self) -> OutPointVec
Packs a vector of binary data into one binary data.
sourceimpl<T> PackVec<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
impl<T> PackVec<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
sourcefn pack(self) -> OutPointVec
fn pack(self) -> OutPointVec
Packs a vector of binary data into one binary data.
sourceimpl<T> PackVec<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
impl<T> PackVec<OutPointVec, OutPoint> for T where
T: IntoIterator<Item = OutPoint>,
sourcefn pack(self) -> OutPointVec
fn pack(self) -> OutPointVec
Packs a vector of binary data into one binary data.
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more