pub struct IrohSessions { /* private fields */ }Expand description
The protocol handler that accepts iroh clients’ MoQ sessions into the cluster.
Mount it on a router with mount.
Implementations§
Source§impl IrohSessions
impl IrohSessions
Sourcepub fn new(cluster: Cluster, pulls: Option<Pulls>) -> Self
pub fn new(cluster: Cluster, pulls: Option<Pulls>) -> Self
Creates the handler for cluster, deciding sessions with relay_policy.
With pulls set, a session that names a ticket in its path pulls the
ticket’s broadcast, as a browser’s does, if the pulls’
Access lets it: see
with_pull_policy. A session that may not
pull, or would exceed the pulls’ Limits, is
refused.
Sourcepub fn with_policy(self, policy: impl Policy<EndpointId>) -> Self
pub fn with_policy(self, policy: impl Policy<EndpointId>) -> Self
Returns this handler with policy deciding sessions.
The media relay asks it after a client’s MoQ SETUP. A rejection closes the session with the rejection’s code. An authorization’s grant bounds what the client publishes into the cluster and what it reads from it, and the session closes when the authorization expires. The media relay does not decide again: a client whose session closed reconnects.
Sourcepub fn with_pull_policy(self, policy: impl Policy<EndpointId>) -> Self
pub fn with_pull_policy(self, policy: impl Policy<EndpointId>) -> Self
Returns this handler with policy deciding who may pull under Access::Authorized.
The media relay asks it about the session’s peer and token at the path of the
ticket’s broadcast, and the session may pull if the authorization lets
it read that path. Without one, no session pulls under
Access::Authorized. It should require a token, as a
Verify without a fallback does,
since an open policy would let every session pull.
Sourcepub fn mount(self, router: RouterBuilder) -> RouterBuilder
pub fn mount(self, router: RouterBuilder) -> RouterBuilder
Mounts this handler on router under every ALPN in moq_transport_iroh::alpns.
The caller may add its own protocols, and spawns the router.
Trait Implementations§
Source§impl Clone for IrohSessions
impl Clone for IrohSessions
Source§impl Debug for IrohSessions
impl Debug for IrohSessions
Source§impl ProtocolHandler for IrohSessions
impl ProtocolHandler for IrohSessions
Source§async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> impl Future<Output = Result<Connection, AcceptError>> + Send
fn on_accepting( &self, accepting: Accepting, ) -> impl Future<Output = Result<Connection, AcceptError>> + Send
Accepting state. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for IrohSessions
impl !UnwindSafe for IrohSessions
impl Freeze for IrohSessions
impl Send for IrohSessions
impl Sync for IrohSessions
impl Unpin for IrohSessions
impl UnsafeUnpin for IrohSessions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
Source§fn accept(
&self,
connection: Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
fn accept( &self, connection: Connection, ) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
fn on_accepting( &self, accepting: Accepting, ) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
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