Struct bee_tangle::tangle::Tangle[][src]

pub struct Tangle<B> { /* fields omitted */ }
Expand description

A Tangle wrapper designed to encapsulate milestone state.

Implementations

Create a new Tangle instance with the given configuration and storage handle.

Shut down the tangle, terminating any and all worker tasks.

Get the configuration of this tangle.

Insert a message into the tangle.

Add a milestone to the tangle.

Remove a milestone from the tangle.

Get the milestone from the tangle that corresponds to the given milestone index.

Get the message associated with the given milestone index from the tangle.

Get the message ID associated with the given milestone index from the tangle.

Return whether the tangle contains the given milestone index.

Get the index of the latest milestone.

Update the index of the lastest milestone.

Get the latest solid milestone index.

Update the latest solid milestone index.

Get the latest confirmed milestone index.

Update the latest confirmed milestone index.

Get the snapshot index.

Update the snapshot index.

Get the pruning index.

Update the pruning index.

pub fn get_entry_point_index(&self) -> MilestoneIndex

Get the entry point index.

pub fn update_entry_point_index(&self, new_index: MilestoneIndex)

Update the entry point index.

Return whether the tangle is within the default sync threshold.

Get the number of milestones until the tangle is synced.

Return whether the tangle is within the given sync threshold.

Return whether the tangle is fully confirmed.

Return whether the tangle is within the given confirmation threshold.

pub async fn get_solid_entry_point_index(
    &self,
    sep: &SolidEntryPoint
) -> Option<MilestoneIndex>

Get the milestone index associated with the given solid entry point.

pub async fn add_solid_entry_point(
    &self,
    sep: SolidEntryPoint,
    index: MilestoneIndex
)

Add the given solid entry point to the given milestone index.

pub async fn get_solid_entry_points(
    &self
) -> HashMap<SolidEntryPoint, MilestoneIndex>

Returns a copy of all solid entry points.

pub async fn remove_solid_entry_point(&self, sep: &SolidEntryPoint)

Removes the given solid entry point from the set of solid entry points.

pub async fn clear_solid_entry_points(&self)

Clear all solid entry points.

pub async fn replace_solid_entry_points(
    &self,
    new_seps: impl IntoIterator<Item = (SolidEntryPoint, MilestoneIndex)>
)

Replaces all solid entry points.

pub async fn is_solid_entry_point(&self, id: &MessageId) -> bool

Returns whether the message associated with given solid entry point is a solid entry point.

Returns whether the message associated with the given message ID is solid.

Get the oldest milestone root snapshot index.

Get the youngest milestone root snapshot index.

Insert the given message ID and parents as a tip.

Update tip scores.

Return messages that require approving.

Reduce tips.

Return the number of non-lazy tips.

Get the data of a vertex associated with the given message_id.

Returns whether the message is stored in the Tangle.

Get the metadata of a vertex associated with the given message_id.

Get the metadata of a vertex associated with the given message_id.

Updates the metadata of a vertex.

Returns the children of a vertex, if we know about them.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.