pub struct NameSystem { /* private fields */ }Expand description
The NameSystem is responsible for both propagating and resolving Sphere
DIDs into an authorized UCAN publish token, resolving into a
[Link
Hosted records can be set via NameSystem::put_record, propagating the record immediately, and repropagating on a specified interval. Records can be resolved via NameSystem::get_record.
See https://github.com/subconsciousnetwork/noosphere/blob/main/design/name-system.md for the full Noosphere Name System spec.
Implementations§
Source§impl NameSystem
impl NameSystem
pub fn new<K: NameSystemKeyMaterial, S: UcanJwtStore + 'static>( key_material: &K, dht_config: DhtConfig, store: Option<S>, ) -> Result<Self>
Trait Implementations§
Source§impl DhtClient for NameSystem
impl DhtClient for NameSystem
Source§fn network_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn network_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns current network information for this node.
Source§fn add_peers<'life0, 'async_trait>(
&'life0 self,
peers: Vec<Multiaddr>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_peers<'life0, 'async_trait>(
&'life0 self,
peers: Vec<Multiaddr>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Adds peers to connect to. Unless bootstrapping a network, at least one peer is needed.
Source§fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Peer>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Peer>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns current network information for this node.
Source§fn listen<'life0, 'async_trait>(
&'life0 self,
listening_address: Multiaddr,
) -> Pin<Box<dyn Future<Output = Result<Multiaddr>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn listen<'life0, 'async_trait>(
&'life0 self,
listening_address: Multiaddr,
) -> Pin<Box<dyn Future<Output = Result<Multiaddr>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts listening for connections on provided address.
Source§fn stop_listening<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop_listening<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stops listening for connections on provided address.
Source§fn bootstrap<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bootstrap<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connects to peers provided in add_peers.
Source§fn address<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Multiaddr>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn address<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Multiaddr>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the listening addresses of this node.
Source§fn put_record<'life0, 'async_trait>(
&'life0 self,
record: LinkRecord,
quorum: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_record<'life0, 'async_trait>(
&'life0 self,
record: LinkRecord,
quorum: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_record<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Did,
) -> Pin<Box<dyn Future<Output = Result<Option<LinkRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_record<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: &'life1 Did,
) -> Pin<Box<dyn Future<Output = Result<Option<LinkRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for NameSystem
impl RefUnwindSafe for NameSystem
impl Send for NameSystem
impl Sync for NameSystem
impl Unpin for NameSystem
impl UnwindSafe for NameSystem
Blanket Implementations§
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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>
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