Struct bee_tangle::ms_tangle::MsTangle [−][src]
pub struct MsTangle<B> { /* fields omitted */ }A Tangle wrapper designed to encapsulate milestone state.
Implementations
impl<B: StorageBackend> MsTangle<B>[src]
impl<B: StorageBackend> MsTangle<B>[src]pub fn new(config: TangleConfig, storage: ResourceHandle<B>) -> Self[src]
pub fn new(config: TangleConfig, storage: ResourceHandle<B>) -> Self[src]Create a new MsTangle instance with the given configuration and storage handle.
pub fn config(&self) -> &TangleConfig[src]
pub fn config(&self) -> &TangleConfig[src]Get the configuration of this tangle.
pub async fn insert(
&self,
message: Message,
hash: MessageId,
metadata: MessageMetadata
) -> Option<MessageRef>[src]
pub async fn insert(
&self,
message: Message,
hash: MessageId,
metadata: MessageMetadata
) -> Option<MessageRef>[src]Insert a message into the tangle.
pub async fn add_milestone(&self, idx: MilestoneIndex, milestone: Milestone)[src]
pub async fn add_milestone(&self, idx: MilestoneIndex, milestone: Milestone)[src]Add a milestone to the tangle.
pub async fn remove_milestone(&self, index: MilestoneIndex)[src]
pub async fn remove_milestone(&self, index: MilestoneIndex)[src]Remove a milestone from the tangle.
pub async fn get_milestone(&self, index: MilestoneIndex) -> Option<Milestone>[src]
pub async fn get_milestone(&self, index: MilestoneIndex) -> Option<Milestone>[src]Get the milestone from the tangle that corresponds to the given milestone index.
pub async fn get_milestone_message(
&self,
index: MilestoneIndex
) -> Option<MessageRef>[src]
pub async fn get_milestone_message(
&self,
index: MilestoneIndex
) -> Option<MessageRef>[src]Get the message associated with the given milestone index from the tangle.
pub async fn get_milestone_message_id(
&self,
index: MilestoneIndex
) -> Option<MessageId>[src]
pub async fn get_milestone_message_id(
&self,
index: MilestoneIndex
) -> Option<MessageId>[src]Get the message ID associated with the given milestone index from the tangle.
pub async fn contains_milestone(&self, idx: MilestoneIndex) -> bool[src]
pub async fn contains_milestone(&self, idx: MilestoneIndex) -> bool[src]Return whether the tangle contains the given milestone index.
pub fn get_latest_milestone_index(&self) -> MilestoneIndex[src]
pub fn get_latest_milestone_index(&self) -> MilestoneIndex[src]Get the index of the latest milestone.
pub fn update_latest_milestone_index(&self, new_index: MilestoneIndex)[src]
pub fn update_latest_milestone_index(&self, new_index: MilestoneIndex)[src]Update the index of the lastest milestone.
pub fn get_solid_milestone_index(&self) -> MilestoneIndex[src]
pub fn get_solid_milestone_index(&self) -> MilestoneIndex[src]Get the latest solid milestone index.
pub fn update_solid_milestone_index(&self, new_index: MilestoneIndex)[src]
pub fn update_solid_milestone_index(&self, new_index: MilestoneIndex)[src]Update the latest solid milestone index.
pub fn get_confirmed_milestone_index(&self) -> MilestoneIndex[src]
pub fn get_confirmed_milestone_index(&self) -> MilestoneIndex[src]Get the latest confirmed milestone index.
pub fn update_confirmed_milestone_index(&self, new_index: MilestoneIndex)[src]
pub fn update_confirmed_milestone_index(&self, new_index: MilestoneIndex)[src]Update the latest confirmed milestone index.
pub fn get_snapshot_index(&self) -> MilestoneIndex[src]
pub fn get_snapshot_index(&self) -> MilestoneIndex[src]Get the snapshot index.
pub fn update_snapshot_index(&self, new_index: MilestoneIndex)[src]
pub fn update_snapshot_index(&self, new_index: MilestoneIndex)[src]Update the snapshot index.
pub fn get_pruning_index(&self) -> MilestoneIndex[src]
pub fn get_pruning_index(&self) -> MilestoneIndex[src]Get the pruning index.
pub fn update_pruning_index(&self, new_index: MilestoneIndex)[src]
pub fn update_pruning_index(&self, new_index: MilestoneIndex)[src]Update the pruning index.
pub fn get_entry_point_index(&self) -> MilestoneIndex[src]
pub fn get_entry_point_index(&self) -> MilestoneIndex[src]Get the entry point index.
pub fn update_entry_point_index(&self, new_index: MilestoneIndex)[src]
pub fn update_entry_point_index(&self, new_index: MilestoneIndex)[src]Update the entry point index.
pub fn get_sync_threshold(&self) -> u32[src]
pub fn get_sync_threshold(&self) -> u32[src]Get the number of milestones until the tangle is synced.
pub fn is_synced_threshold(&self, threshold: u32) -> bool[src]
pub fn is_synced_threshold(&self, threshold: u32) -> bool[src]Return whether the tangle is within the given sync threshold.
pub fn is_confirmed(&self) -> bool[src]
pub fn is_confirmed(&self) -> bool[src]Return whether the tangle is fully confirmed.
pub fn is_confirmed_threshold(&self, threshold: u32) -> bool[src]
pub fn is_confirmed_threshold(&self, threshold: u32) -> bool[src]Return whether the tangle is within the given confirmation threshold.
pub async fn get_solid_entry_point_index(
&self,
sep: &SolidEntryPoint
) -> Option<MilestoneIndex>[src]
pub async fn get_solid_entry_point_index(
&self,
sep: &SolidEntryPoint
) -> Option<MilestoneIndex>[src]Get the milestone index associated with the given solid entry point.
pub async fn add_solid_entry_point(
&self,
sep: SolidEntryPoint,
index: MilestoneIndex
)[src]
pub async fn add_solid_entry_point(
&self,
sep: SolidEntryPoint,
index: MilestoneIndex
)[src]Add the given solid entry point to the given milestone index.
pub async fn get_solid_entry_points(
&self
) -> HashMap<SolidEntryPoint, MilestoneIndex>[src]
pub async fn get_solid_entry_points(
&self
) -> HashMap<SolidEntryPoint, MilestoneIndex>[src]Returns a copy of all solid entry points.
pub async fn remove_solid_entry_point(&self, sep: &SolidEntryPoint)[src]
pub async fn remove_solid_entry_point(&self, sep: &SolidEntryPoint)[src]Removes the given solid entry point from the set of solid entry points.
pub async fn clear_solid_entry_points(&self)[src]
pub async fn clear_solid_entry_points(&self)[src]Clear all solid entry points.
pub async fn replace_solid_entry_points(
&self,
new_seps: impl IntoIterator<Item = (SolidEntryPoint, MilestoneIndex)>
)[src]
pub async fn replace_solid_entry_points(
&self,
new_seps: impl IntoIterator<Item = (SolidEntryPoint, MilestoneIndex)>
)[src]Replaces all solid entry points.
pub async fn is_solid_entry_point(&self, id: &MessageId) -> bool[src]
pub async fn is_solid_entry_point(&self, id: &MessageId) -> bool[src]Returns whether the message associated with given solid entry point is a solid entry point.
pub async fn is_solid_message(&self, id: &MessageId) -> bool[src]
pub async fn is_solid_message(&self, id: &MessageId) -> bool[src]Returns whether the message associated with the given message ID is solid.
pub async fn omrsi(&self, id: &MessageId) -> Option<IndexId>[src]
pub async fn omrsi(&self, id: &MessageId) -> Option<IndexId>[src]Get the oldest milestone root snapshot index.
pub async fn ymrsi(&self, id: &MessageId) -> Option<IndexId>[src]
pub async fn ymrsi(&self, id: &MessageId) -> Option<IndexId>[src]Get the youngest milestone root snapshot index.
pub async fn insert_tip(&self, message_id: MessageId, parents: Vec<MessageId>)[src]
pub async fn insert_tip(&self, message_id: MessageId, parents: Vec<MessageId>)[src]Insert the given message ID and parents as a tip.
pub async fn update_tip_scores(&self)[src]
pub async fn update_tip_scores(&self)[src]Update tip scores.
pub async fn get_messages_to_approve(&self) -> Option<Vec<MessageId>>[src]
pub async fn get_messages_to_approve(&self) -> Option<Vec<MessageId>>[src]Return messages that require approving.
pub async fn reduce_tips(&self)[src]
pub async fn reduce_tips(&self)[src]Reduce tips.
pub async fn non_lazy_tips_num(&self) -> usize[src]
pub async fn non_lazy_tips_num(&self) -> usize[src]Return the number of non-lazy tips.
Methods from Deref<Target = Tangle<MessageMetadata, StorageHooks<B>>>
pub async fn insert(
&self,
message_id: MessageId,
message: Message,
metadata: T
) -> Option<MessageRef>[src]
pub async fn insert(
&self,
message_id: MessageId,
message: Message,
metadata: T
) -> Option<MessageRef>[src]Inserts a message, and returns a thread-safe reference to it in case it didn’t already exist.
pub async fn get_with<R>(
&self,
message_id: &MessageId,
f: impl FnOnce(&mut Vertex<T>) -> Option<R>
) -> Option<R>[src]
pub async fn get_with<R>(
&self,
message_id: &MessageId,
f: impl FnOnce(&mut Vertex<T>) -> Option<R>
) -> Option<R>[src]Get the data of a vertex associated with the given message_id.
pub async fn get(&self, message_id: &MessageId) -> Option<MessageRef>[src]
pub async fn get(&self, message_id: &MessageId) -> Option<MessageRef>[src]Get the data of a vertex associated with the given message_id.
pub async fn contains(&self, message_id: &MessageId) -> bool[src]
pub async fn contains(&self, message_id: &MessageId) -> bool[src]Returns whether the message is stored in the Tangle.
pub async fn get_metadata(&self, message_id: &MessageId) -> Option<T>[src]
pub async fn get_metadata(&self, message_id: &MessageId) -> Option<T>[src]Get the metadata of a vertex associated with the given message_id.
pub async fn get_metadata_maybe(&self, message_id: &MessageId) -> Option<T>[src]
pub async fn get_metadata_maybe(&self, message_id: &MessageId) -> Option<T>[src]Get the metadata of a vertex associated with the given message_id, if it’s in the cache.
pub async fn get_vertex(
&self,
message_id: &MessageId
) -> Option<impl Deref<Target = Vertex<T>> + '_>[src]
pub async fn get_vertex(
&self,
message_id: &MessageId
) -> Option<impl Deref<Target = Vertex<T>> + '_>[src]Get the metadata of a vertex associated with the given message_id.
pub async fn set_metadata(&self, message_id: &MessageId, metadata: T)[src]
pub async fn set_metadata(&self, message_id: &MessageId, metadata: T)[src]Updates the metadata of a particular vertex.
pub async fn update_metadata<R, Update>(
&self,
message_id: &MessageId,
update: Update
) -> Option<R> where
Update: FnOnce(&mut T) -> R, [src]
pub async fn update_metadata<R, Update>(
&self,
message_id: &MessageId,
update: Update
) -> Option<R> where
Update: FnOnce(&mut T) -> R, [src]Updates the metadata of a vertex.
pub async fn get_children(
&self,
message_id: &MessageId
) -> Option<Vec<MessageId>>[src]
pub async fn get_children(
&self,
message_id: &MessageId
) -> Option<Vec<MessageId>>[src]Returns the children of a vertex, if we know about them.
pub async fn num_children(&self, message_id: &MessageId) -> usize[src]
pub async fn num_children(&self, message_id: &MessageId) -> usize[src]Returns the number of children of a vertex.
Trait Implementations
impl<B> Deref for MsTangle<B>[src]
impl<B> Deref for MsTangle<B>[src]type Target = Tangle<MessageMetadata, StorageHooks<B>>
type Target = Tangle<MessageMetadata, StorageHooks<B>>The resulting type after dereferencing.
Auto Trait Implementations
impl<B> !RefUnwindSafe for MsTangle<B>
impl<B> Send for MsTangle<B> where
B: Send + Sync,
B: Send + Sync,
impl<B> Sync for MsTangle<B> where
B: Send + Sync,
B: Send + Sync,
impl<B> Unpin for MsTangle<B>
impl<B> UnwindSafe for MsTangle<B> where
B: RefUnwindSafe,
B: RefUnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,