pub struct LeafIngress {
pub lock: Mutex<()>,
/* private fields */
}Fields§
§lock: Mutex<()>Serialize a leaf’s check, delivery and floor commit. Held across the runtime call; callers use Tokio’s async mutex guard.
Implementations§
Source§impl LeafIngress
impl LeafIngress
Sourcepub fn open(root: &Path, machine_key: SigningKey) -> Result<Self, LeafError>
pub fn open(root: &Path, machine_key: SigningKey) -> Result<Self, LeafError>
root/registry/<id>.json holds enrollment artifacts; root/floors
is service-owned and must never be writable by a leaf process.
Machine-service live binding check. The callback must prove the registered tenant currently holds the user key named by the chain.
Sourcepub fn still_enrolled(&self, cert: &LeafCertificate, now: u64) -> bool
pub fn still_enrolled(&self, cert: &LeafCertificate, now: u64) -> bool
Recheck an idle subscribed connection. Enrollment removal, exact certificate replacement and expiry all terminate its push route.
Sourcepub fn prepare(
&self,
frame: &SignedPublish,
now: u64,
) -> Result<Prepare, LeafError>
pub fn prepare( &self, frame: &SignedPublish, now: u64, ) -> Result<Prepare, LeafError>
Validate against the installed certificate and durable replay floor.
Duplicate is safe to ACK but must never be delivered again.
Sourcepub fn commit(&self, frame: &SignedPublish) -> Result<(), LeafError>
pub fn commit(&self, frame: &SignedPublish) -> Result<(), LeafError>
Call only after delivery returned success. Sync file and directory
before sending an ACK. A crash between delivery and commit can replay
once; downstream operations must be idempotent by (leaf_id, seq).
pub fn ack(&self, frame: &SignedPublish) -> PublishAck
Sourcepub async fn serve_discovery(
&self,
mesh_addr: SocketAddr,
leaf_addr: SocketAddr,
) -> Result<(), LeafError>
pub async fn serve_discovery( &self, mesh_addr: SocketAddr, leaf_addr: SocketAddr, ) -> Result<(), LeafError>
UDP discovery on the mesh listener’s address and port + 1. Requests
carry WLD1 | leaf id (32 ASCII hex) | nonce (16). The response is a
machine-signed CBOR advertisement bound to that nonce and enrollment.
Auto Trait Implementations§
impl !Freeze for LeafIngress
impl !RefUnwindSafe for LeafIngress
impl !UnwindSafe for LeafIngress
impl Send for LeafIngress
impl Sync for LeafIngress
impl Unpin for LeafIngress
impl UnsafeUnpin for LeafIngress
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> 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