pub struct ChannelGatewayBuilder { /* private fields */ }Expand description
Builds a ChannelGateway.
Implementations§
Source§impl ChannelGatewayBuilder
impl ChannelGatewayBuilder
Sourcepub fn sink(self, sink: Arc<dyn ChannelSink>) -> Self
pub fn sink(self, sink: Arc<dyn ChannelSink>) -> Self
Adds a channel’s adapter; a second adapter of the same channel replaces the first.
Sourcepub fn target(self, target: impl Into<String>) -> Self
pub fn target(self, target: impl Into<String>) -> Self
The target paired accounts’ turns run; defaults to adk-rust, the harness.
Sourcepub fn home_url(self, url: impl Into<String>) -> Self
pub fn home_url(self, url: impl Into<String>) -> Self
The web home’s address, which cards and notices link to for what chat cannot do.
Sourcepub fn code_ttl(self, ttl: Duration) -> Self
pub fn code_ttl(self, ttl: Duration) -> Self
How long a pairing code sent to an unpaired account works; defaults to an hour.
Sourcepub fn max_waiting(self, max: usize) -> Self
pub fn max_waiting(self, max: usize) -> Self
How many accounts of one channel may wait to be paired at once; defaults to five.
Sourcepub fn doorbell(self, doorbell: Arc<ChannelDoorbell>) -> Self
pub fn doorbell(self, doorbell: Arc<ChannelDoorbell>) -> Self
Rings doorbell’s decisions once ChannelGateway::start runs.
Sourcepub fn resweep(self, every: Duration) -> Self
pub fn resweep(self, every: Duration) -> Self
How often a started gateway rings the decisions still waiting, as
ChannelGateway::ring_waiting does; defaults to a minute.
Sourcepub fn money_tools(
self,
names: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn money_tools( self, names: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Adds tools whose calls move money, which chat never decides (spec 3.3 §7.4 rule 4):
their cards link to the home and carry no answers. A name ending in * names every
tool it starts. The list starts with payments_*, the tools adk-payments
publishes, beside the tools the host’s drivers declare financial
(ChannelHost::moves_money).
§Example
let builder = builder.money_tools(["transfer", "bank_*"]);Sourcepub fn route(self, route: Arc<dyn InboundRoute>) -> Self
pub fn route(self, route: Arc<dyn InboundRoute>) -> Self
Lets route decide each inbound message before the gateway does (spec 3.5 §10 X12):
a message it takes gets no pairing code, starts no turn and answers nothing
(InboundOutcome::Routed). Without one, the gateway decides every message.
§Example
let builder = builder.route(route);Sourcepub fn build(self) -> ChannelGateway
pub fn build(self) -> ChannelGateway
The gateway.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ChannelGatewayBuilder
impl !UnwindSafe for ChannelGatewayBuilder
impl Forget for ChannelGatewayBuilder
impl Freeze for ChannelGatewayBuilderwhere
*const ArcInner<dyn ChannelHost> is !null: Freeze,
PhantomData<ArcInner<dyn ChannelHost>>: Freeze,
*const ArcInner<dyn ChannelBindingStore> is !null: Freeze,
PhantomData<ArcInner<dyn ChannelBindingStore>>: Freeze,
*const LeafNode<String, Arc<dyn ChannelSink>> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Arc<dyn ChannelSink>)>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<ChannelDoorbell> is !null: Freeze,
PhantomData<ArcInner<ChannelDoorbell>>: Freeze,
PhantomData<String>: Freeze,
*const ArcInner<dyn InboundRoute> is !null: Freeze,
PhantomData<ArcInner<dyn InboundRoute>>: Freeze,
impl Move for ChannelGatewayBuilder
impl Send for ChannelGatewayBuilderwhere
Arc<dyn ChannelHost>: Send,
Arc<dyn ChannelBindingStore>: Send,
NodeRef<Owned, String, Arc<dyn ChannelSink>, LeafOrInternal>: Send,
BoxRaw<(String, Arc<dyn ChannelSink>)>: Send,
RawVecInner: Send,
Arc<ChannelDoorbell>: Send,
Arc<dyn InboundRoute>: Send,
impl Sync for ChannelGatewayBuilderwhere
Arc<dyn ChannelHost>: Sync,
Arc<dyn ChannelBindingStore>: Sync,
NodeRef<Owned, String, Arc<dyn ChannelSink>, LeafOrInternal>: Sync,
BoxRaw<(String, Arc<dyn ChannelSink>)>: Sync,
RawVecInner: Sync,
Arc<ChannelDoorbell>: Sync,
Arc<dyn InboundRoute>: Sync,
impl Unpin for ChannelGatewayBuilderwhere
Arc<dyn ChannelHost>: Unpin,
Arc<dyn ChannelBindingStore>: Unpin,
*const LeafNode<String, Arc<dyn ChannelSink>> is !null: Unpin,
Box<(String, Arc<dyn ChannelSink>)>: Unpin,
*const u8 is !null: Unpin,
Arc<ChannelDoorbell>: Unpin,
Arc<dyn InboundRoute>: Unpin,
impl UnsafeUnpin for ChannelGatewayBuilderwhere
*const ArcInner<dyn ChannelHost> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ChannelHost>>: UnsafeUnpin,
*const ArcInner<dyn ChannelBindingStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ChannelBindingStore>>: UnsafeUnpin,
*const LeafNode<String, Arc<dyn ChannelSink>> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Arc<dyn ChannelSink>)>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<ChannelDoorbell> is !null: UnsafeUnpin,
PhantomData<ArcInner<ChannelDoorbell>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<dyn InboundRoute> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn InboundRoute>>: UnsafeUnpin,
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§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::RequestSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.