Struct grin_chain::types::Tip[][src]

pub struct Tip {
    pub height: u64,
    pub last_block_h: Hash,
    pub prev_block_h: Hash,
    pub total_difficulty: Difficulty,
}

The tip of a fork. A handle to the fork ancestry from its leaf in the blockchain tree. References the max height and the latest and previous blocks for convenience and the total difficulty.

Fields

height: u64

Height of the tip (max height of the fork)

last_block_h: Hash

Last block pushed to the fork

prev_block_h: Hash

Previous block

total_difficulty: Difficulty

Total difficulty accumulated on that fork

Implementations

impl Tip[src]

pub fn from_header(header: &BlockHeader) -> Tip[src]

Creates a new tip based on provided header.

Trait Implementations

impl Clone for Tip[src]

fn clone(&self) -> Tip[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Tip[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Tip[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'de> Deserialize<'de> for Tip[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Hashed for Tip[src]

fn hash(&self) -> Hash[src]

The hash of the underlying block.

impl PartialEq<Tip> for Tip[src]

fn eq(&self, other: &Tip) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Tip) -> bool[src]

This method tests for !=.

impl Readable for Tip[src]

fn read<R: Reader>(reader: &mut R) -> Result<Tip, Error>[src]

Reads the data necessary to this Readable from the provided reader

impl Serialize for Tip[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Writeable for Tip[src]

Serialization of a tip, required to save to datastore.

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>[src]

Write the data held by this Writeable to the provided writer

impl Copy for Tip[src]

impl StructuralPartialEq for Tip[src]

Auto Trait Implementations

impl RefUnwindSafe for Tip

impl Send for Tip

impl Sync for Tip

impl Unpin for Tip

impl UnwindSafe for Tip

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CloneAny for T where
    T: Any + Clone

pub fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>

pub fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send, Global> where
    T: Send

pub fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync, Global> where
    T: Sync

pub fn clone_any_send_sync(
    &self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
    T: Send + Sync

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Send + Sync + Clone

pub fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>

Clone this value, and then immediately put it into a Box behind a trait object of this trait. Read more

pub fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

pub fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>

Clone this value, and then immediately put it into a Box behind a trait object of this trait. Read more

pub fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more

impl<T> SafeBorrow<T> for T where
    T: ?Sized

pub fn borrow_replacement(ptr: &T) -> &T

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<H> ShortIdentifiable for H where
    H: Hashed
[src]

pub fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId[src]

Generate a short_id via the following -

  • extract k0/k1 from block_hash hashed with the nonce (first two u64 values) * initialize a siphasher24 with k0/k1
    • self.hash() passing in the siphasher24 instance
    • drop the 2 most significant bytes (to return a 6 byte short_id)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> UnsafeAny for T where
    T: Any