pub struct Subscriber { /* private fields */ }Expand description
A subscription to a sync group.
Receives Samples as peers publish new data.
Implementations§
Source§impl Subscriber
impl Subscriber
Sourcepub async fn connect(
socket: impl AsRef<Path>,
group_prefix: impl Into<Name>,
) -> Result<Self, AppError>
pub async fn connect( socket: impl AsRef<Path>, group_prefix: impl Into<Name>, ) -> Result<Self, AppError>
Connect to a router and subscribe to a sync group prefix.
Uses SVS as the sync protocol. The subscriber registers the group prefix and begins receiving updates from peers.
Sourcepub async fn connect_with_config(
socket: impl AsRef<Path>,
group_prefix: impl Into<Name>,
config: SubscriberConfig,
) -> Result<Self, AppError>
pub async fn connect_with_config( socket: impl AsRef<Path>, group_prefix: impl Into<Name>, config: SubscriberConfig, ) -> Result<Self, AppError>
Connect with explicit configuration.
Sourcepub async fn connect_psync(
socket: impl AsRef<Path>,
group_prefix: impl Into<Name>,
) -> Result<Self, AppError>
pub async fn connect_psync( socket: impl AsRef<Path>, group_prefix: impl Into<Name>, ) -> Result<Self, AppError>
Connect to a router and subscribe to a sync group using PSync.
Identical to connect but uses PSync instead of SVS.
Use this when peers in the group also use PSync.
Sourcepub async fn connect_psync_with_config(
socket: impl AsRef<Path>,
group_prefix: impl Into<Name>,
psync_config: PSyncConfig,
) -> Result<Self, AppError>
pub async fn connect_psync_with_config( socket: impl AsRef<Path>, group_prefix: impl Into<Name>, psync_config: PSyncConfig, ) -> Result<Self, AppError>
Connect with PSync and explicit configuration.
Sourcepub fn from_connection(
conn: NdnConnection,
group: Name,
local_name: Name,
config: SubscriberConfig,
) -> Result<Self, AppError>
pub fn from_connection( conn: NdnConnection, group: Name, local_name: Name, config: SubscriberConfig, ) -> Result<Self, AppError>
Create from an in-process connection (embedded engine).
Auto Trait Implementations§
impl Freeze for Subscriber
impl RefUnwindSafe for Subscriber
impl Send for Subscriber
impl Sync for Subscriber
impl Unpin for Subscriber
impl UnwindSafe for Subscriber
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
Mutably borrows from an owned value. Read more