pub struct GraphSync<S: BlockStore> { /* private fields */ }Expand description
GraphSync protocol handler
Implementations§
Source§impl<S: BlockStore> GraphSync<S>
impl<S: BlockStore> GraphSync<S>
Sourcepub async fn start_traversal(
&self,
root: Cid,
selector: Selector,
mode: TraversalMode,
) -> Result<Arc<DagTraversal<S>>>
pub async fn start_traversal( &self, root: Cid, selector: Selector, mode: TraversalMode, ) -> Result<Arc<DagTraversal<S>>>
Start a new traversal
Sourcepub async fn resume_traversal(
&self,
checkpoint: TraversalCheckpoint,
selector: Selector,
mode: TraversalMode,
) -> Result<Arc<DagTraversal<S>>>
pub async fn resume_traversal( &self, checkpoint: TraversalCheckpoint, selector: Selector, mode: TraversalMode, ) -> Result<Arc<DagTraversal<S>>>
Resume a traversal from checkpoint
Sourcepub async fn get_traversal(&self, root: &Cid) -> Option<Arc<DagTraversal<S>>>
pub async fn get_traversal(&self, root: &Cid) -> Option<Arc<DagTraversal<S>>>
Get an active traversal
Sourcepub async fn remove_traversal(&self, root: &Cid)
pub async fn remove_traversal(&self, root: &Cid)
Remove a completed traversal
Sourcepub async fn active_count(&self) -> usize
pub async fn active_count(&self) -> usize
Get number of active traversals
Auto Trait Implementations§
impl<S> Freeze for GraphSync<S>
impl<S> !RefUnwindSafe for GraphSync<S>
impl<S> Send for GraphSync<S>
impl<S> Sync for GraphSync<S>
impl<S> Unpin for GraphSync<S>
impl<S> !UnwindSafe for GraphSync<S>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more