Struct bee_tangle::Tangle [−][src]
pub struct Tangle<T, H = NullHooks<T>> where
T: Clone, { /* fields omitted */ }A foundational, thread-safe graph datastructure to represent the IOTA Tangle.
Implementations
impl<T, H: Hooks<T>> Tangle<T, H> where
T: Clone, [src]
impl<T, H: Hooks<T>> Tangle<T, H> where
T: Clone, [src]pub fn with_capacity(self, cap: usize) -> Self[src]
pub fn with_capacity(self, cap: usize) -> Self[src]Create a new tangle with the given capacity.
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
Auto Trait Implementations
impl<T, H = NullHooks<T>> !RefUnwindSafe for Tangle<T, H>
impl<T, H> Send for Tangle<T, H> where
H: Send,
T: Send,
H: Send,
T: Send,
impl<T, H> Sync for Tangle<T, H> where
H: Sync,
T: Send + Sync,
H: Sync,
T: Send + Sync,
impl<T, H> Unpin for Tangle<T, H> where
H: Unpin,
T: Unpin,
H: Unpin,
T: Unpin,
impl<T, H> UnwindSafe for Tangle<T, H> where
H: UnwindSafe,
T: UnwindSafe,
H: UnwindSafe,
T: UnwindSafe,
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>,