pub(super) struct Tiers<'a> {
state: &'a AppState,
auth_via: ReactiveAuthVia,
caller_uid: &'a str,
req: &'a InjectionRequest,
resp: &'a InjectionResponse,
forwarded_req: InjectionRequest,
same_host_req: InjectionRequest,
same_host_tier: &'a str,
candidate_seen: bool,
files_too_old: bool,
alias: Option<String>,
silent_peer: bool,
}Expand description
What the tiers share while one jekt looks for its target.
Fields§
§state: &'a AppState§auth_via: ReactiveAuthVia§caller_uid: &'a str§req: &'a InjectionRequest§resp: &'a InjectionResponse§forwarded_req: InjectionRequest§same_host_req: InjectionRequest§same_host_tier: &'a str§candidate_seen: boolWhether any forwarding tier found the target alive elsewhere. A target that is alive but refused is not “absent” and is never held here (durable jekt spec §2.1, condition 3); a same-host entry whose process is dead — every entry after an srv restart, which changes its port — is not a candidate, so the first message after a restart is held.
files_too_old: boolA candidate an older build registered can’t take files (spec §3.4).
alias: Option<String>A former name’s agent, or a display name’s, runs as its slug (former_slug).
silent_peer: boolThe LAN peer was sent the message and gave no answer in time.
Implementations§
Source§impl<'a> Tiers<'a>
impl<'a> Tiers<'a>
pub(super) fn new( state: &'a AppState, auth_via: ReactiveAuthVia, caller_uid: &'a str, req: &'a InjectionRequest, resp: &'a InjectionResponse, ) -> Self
Sourcepub(super) async fn run(self, replay: &mut Reservation) -> Option<Value>
pub(super) async fn run(self, replay: &mut Reservation) -> Option<Value>
Tries each tier in turn; Some is the answer to send back. None: every tier
declined, so the caller returns the local error.
Sourcefn note_flow(&self, via: MessageFlowVia, body: &Value, to_host: Option<&str>)
fn note_flow(&self, via: MessageFlowVia, body: &Value, to_host: Option<&str>)
Tells the Atlas map what body, the answer of a forwarding tier, made of the message.
Sourceasync fn same_host_sidecar(&mut self) -> Option<Value>
async fn same_host_sidecar(&mut self) -> Option<Value>
Tier 2a: same host, a different sidecar of this channel (file registry → HTTP loopback).
async fn other_channels(&mut self) -> Option<Value>
async fn lan_peer(&mut self) -> Option<Value>
async fn relay_or_hold(&mut self, replay: &mut Reservation) -> Option<Value>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Tiers<'a>
impl<'a> !UnwindSafe for Tiers<'a>
impl<'a> Freeze for Tiers<'a>
impl<'a> Send for Tiers<'a>
impl<'a> Sync for Tiers<'a>
impl<'a> Unpin for Tiers<'a>
impl<'a> UnsafeUnpin for Tiers<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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