pub struct CogMesh {
pub counters: CogMeshCounters,
/* private fields */
}Expand description
One node’s cog mesh: tunnel, optional steward relay, requester side.
Fields§
§counters: CogMeshCountersCounters.
Implementations§
Source§impl CogMesh
impl CogMesh
Sourcepub fn new(
exchange: Arc<ArtifactExchange>,
store: Arc<CheckoutGrantStore>,
sender: Arc<dyn PeerSender>,
relay: Option<Arc<CheckoutRelay>>,
) -> Arc<Self> ⓘ
pub fn new( exchange: Arc<ArtifactExchange>, store: Arc<CheckoutGrantStore>, sender: Arc<dyn PeerSender>, relay: Option<Arc<CheckoutRelay>>, ) -> Arc<Self> ⓘ
A node’s cog mesh. relay is Some only on the steward.
Sourcepub fn tunnel(&self) -> &Arc<ArtifactTunnel> ⓘ
pub fn tunnel(&self) -> &Arc<ArtifactTunnel> ⓘ
The artifact tunnel (its ArtifactTunnel::dialer is the production
crate::mesh_swarm_fetch::PeerDialer).
Sourcepub fn set_relay(&self, relay: Option<Arc<CheckoutRelay>>)
pub fn set_relay(&self, relay: Option<Arc<CheckoutRelay>>)
Install (or with None remove) the steward relay.
Sourcepub fn relay(&self) -> Option<Arc<CheckoutRelay>>
pub fn relay(&self) -> Option<Arc<CheckoutRelay>>
The steward relay, when this node runs one.
Sourcepub async fn checkout_as(
&self,
principal: &str,
req: &CheckoutWire,
) -> Result<SignedGrant, CheckoutRefusal>
pub async fn checkout_as( &self, principal: &str, req: &CheckoutWire, ) -> Result<SignedGrant, CheckoutRefusal>
An RPC caller on the steward asks for a checkout, as principal.
Sourcepub async fn checkout_local(
&self,
req: &CheckoutWire,
) -> Result<SignedGrant, CheckoutRefusal>
pub async fn checkout_local( &self, req: &CheckoutWire, ) -> Result<SignedGrant, CheckoutRefusal>
The steward’s own kernel asks for a checkout.
Sourcepub async fn request_checkout(
&self,
steward: &str,
req: CheckoutWire,
timeout: Duration,
) -> Result<SignedGrant, CheckoutRefusal>
pub async fn request_checkout( &self, steward: &str, req: CheckoutWire, timeout: Duration, ) -> Result<SignedGrant, CheckoutRefusal>
Ask steward (a verified node) for a checkout. The returned grant is
verified and registered here, so this node can fetch and share bytes.
Sourcepub async fn on_delivery(
self: &Arc<Self>,
from: &PeerCtx,
msg: KernelMessage,
) -> bool
pub async fn on_delivery( self: &Arc<Self>, from: &PeerCtx, msg: KernelMessage, ) -> bool
Route one delivery on a feature topic. Returns false when the topic is not one of ours (the caller passes it on).
Auto Trait Implementations§
impl !Freeze for CogMesh
impl !RefUnwindSafe for CogMesh
impl !UnwindSafe for CogMesh
impl Send for CogMesh
impl Sync for CogMesh
impl Unpin for CogMesh
impl UnsafeUnpin for CogMesh
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
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