pub struct NamespaceRouting { /* private fields */ }Expand description
The routing context a clustered boot threads into every
NamespaceMinter.
Implementations§
Source§impl NamespaceRouting
impl NamespaceRouting
Sourcepub fn new(
shards: Arc<dyn NamespaceShardResolver>,
owners: Arc<dyn MintShardOwners>,
forwarder: Arc<dyn MintForwarder>,
) -> Self
pub fn new( shards: Arc<dyn NamespaceShardResolver>, owners: Arc<dyn MintShardOwners>, forwarder: Arc<dyn MintForwarder>, ) -> Self
Build the routing context over its three handles, with no caller credentials yet.
Sourcepub fn with_credentials(self, credentials: MintCredentials) -> Self
pub fn with_credentials(self, credentials: MintCredentials) -> Self
Attach the inbound request’s caller credentials for this request’s mints.
Sourcepub fn route_for(&self, name: &str) -> MintRoute
pub fn route_for(&self, name: &str) -> MintRoute
Where name’s mint must execute.
Decision order: resolve the name’s registry shard, then ask the directory
who owns it. Local and Unknown both execute here — the second
deliberately, so the receiver fence (the enforcement) answers rather than
the directory (a hint).
Sourcepub async fn forward(
&self,
name: &str,
target: SocketAddr,
shard: usize,
origin: NamespaceOrigin,
) -> Result<(), ServerError>
pub async fn forward( &self, name: &str, target: SocketAddr, shard: usize, origin: NamespaceOrigin, ) -> Result<(), ServerError>
Forward name’s mint to target, surfacing exactly one truthful typed
refusal on failure.
§Errors
Returns the owner’s refusal verbatim when it answered, or a typed
not_owner naming the namespace and its shard when the forward reached
no decision. Never retries internally — the client owns retry policy.
Trait Implementations§
Source§impl Clone for NamespaceRouting
impl Clone for NamespaceRouting
Source§fn clone(&self) -> NamespaceRouting
fn clone(&self) -> NamespaceRouting
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for NamespaceRouting
impl !UnwindSafe for NamespaceRouting
impl Freeze for NamespaceRouting
impl Send for NamespaceRouting
impl Sync for NamespaceRouting
impl Unpin for NamespaceRouting
impl UnsafeUnpin for NamespaceRouting
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request