pub struct Peer { /* private fields */ }Expand description
One peer in a Cluster: a full Instance plus the handles a test needs to
act as that peer. It does not hold the peer’s application databases — the
test opens and keeps those.
Implementations§
Source§impl Peer
impl Peer
Sourcepub fn user_mut(&mut self) -> &mut User
pub fn user_mut(&mut self) -> &mut User
Mutable user session, for create_database / open_database directly.
Sourcepub fn key_id(&self) -> &PublicKey
pub fn key_id(&self) -> &PublicKey
This peer’s signing key id (the SigKey for its database operations).
Sourcepub fn key_name(&self) -> &str
pub fn key_name(&self) -> &str
The display name of this peer’s signing key, for naming it in a bootstrap request.
Sourcepub async fn serve(&mut self, tree: &ID) -> Result<()>
pub async fn serve(&mut self, tree: &ID) -> Result<()>
Mark tree sync-enabled on this peer so its sync handler will serve it to
bootstrapping peers. Delegates to User::enable_sync, which flips the
user’s preference and recomputes the host’s combined sync state — the same
path a real consumer takes. The database must already be tracked (it is, on
any peer that created it via create_database or joined it via
Cluster::bootstrap). Pure plumbing: set whatever auth the test needs on
the database before calling this.
Auto Trait Implementations§
impl Freeze for Peer
impl !RefUnwindSafe for Peer
impl Send for Peer
impl Sync for Peer
impl Unpin for Peer
impl UnsafeUnpin for Peer
impl !UnwindSafe for Peer
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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