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.
Get the configuration of this tangle.
pub async fn insert(
&self,
message: Message,
message_id: MessageId,
metadata: MessageMetadata
) -> Option<MessageRef>
pub async fn insert(
&self,
message: Message,
message_id: MessageId,
metadata: MessageMetadata
) -> Option<MessageRef>
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.
Get the entry point index.
Update the entry point index.
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>
pub async fn get_solid_entry_point_index(
&self,
sep: &SolidEntryPoint
) -> Option<MilestoneIndex>
Get the milestone index associated with the given solid entry point.
Add the given solid entry point to the given milestone index.
Returns a copy of all solid entry points.
Removes the given solid entry point from the set of solid entry points.
Clear all solid entry points.
pub async fn replace_solid_entry_points(
&self,
new_seps: impl IntoIterator<Item = (SolidEntryPoint, MilestoneIndex)>
)
pub async fn replace_solid_entry_points(
&self,
new_seps: impl IntoIterator<Item = (SolidEntryPoint, MilestoneIndex)>
)
Replaces all solid entry points.
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
.
pub async fn get_vertex(
&self,
message_id: &MessageId
) -> Option<impl Deref<Target = Vertex> + '_>
pub async fn get_vertex(
&self,
message_id: &MessageId
) -> Option<impl Deref<Target = Vertex> + '_>
Get the metadata of a vertex associated with the given message_id
.
pub async fn update_metadata<R, Update>(
&self,
message_id: &MessageId,
update: Update
) -> Option<R> where
Update: FnOnce(&mut MessageMetadata) -> R,
pub async fn update_metadata<R, Update>(
&self,
message_id: &MessageId,
update: Update
) -> Option<R> where
Update: FnOnce(&mut MessageMetadata) -> R,
Updates the metadata of a vertex.