Struct ockam::remote::RemoteRelay
source · pub struct RemoteRelay { /* private fields */ }
Expand description
This Worker is responsible for registering on Ockam Orchestrator and forwarding messages to local Worker
Implementations§
source§impl RemoteRelay
impl RemoteRelay
sourcepub async fn create_static(
ctx: &Context,
hub_route: impl Into<Route>,
alias: impl Into<String>,
options: RemoteRelayOptions
) -> Result<RemoteRelayInfo>
pub async fn create_static( ctx: &Context, hub_route: impl Into<Route>, alias: impl Into<String>, options: RemoteRelayOptions ) -> Result<RemoteRelayInfo>
Create and start static RemoteRelay at predefined address with given Ockam Orchestrator route
sourcepub async fn create(
ctx: &Context,
hub_route: impl Into<Route>,
options: RemoteRelayOptions
) -> Result<RemoteRelayInfo>
pub async fn create( ctx: &Context, hub_route: impl Into<Route>, options: RemoteRelayOptions ) -> Result<RemoteRelayInfo>
Create and start new ephemeral RemoteRelay at random address with given Ockam Hub route
sourcepub async fn create_static_without_heartbeats(
ctx: &Context,
hub_route: impl Into<Route>,
alias: impl Into<String>,
options: RemoteRelayOptions
) -> Result<RemoteRelayInfo>
pub async fn create_static_without_heartbeats( ctx: &Context, hub_route: impl Into<Route>, alias: impl Into<String>, options: RemoteRelayOptions ) -> Result<RemoteRelayInfo>
Create and start new static RemoteRelay without heart beats
This is a temporary kind of RemoteRelay that will only run on
rust nodes (hence the forwarding_service
addr to create static relays).
We will use it while we don’t have heartbeats implemented on rust nodes.
Trait Implementations§
source§impl Worker for RemoteRelay
impl Worker for RemoteRelay
§type Context = Context
type Context = Context
The API and other resources available for the worker during message
processing. Read more
§type Message = Any
type Message = Any
The type of Message the Worker is sent in
Self::handle_message
.source§fn initialize<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Override initialisation behaviour.
source§fn handle_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context,
msg: Routed<Self::Message>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context,
msg: Routed<Self::Message>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Try to open and handle a typed message.
Auto Trait Implementations§
impl !RefUnwindSafe for RemoteRelay
impl Send for RemoteRelay
impl Sync for RemoteRelay
impl Unpin for RemoteRelay
impl !UnwindSafe for RemoteRelay
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
Mutably borrows from an owned value. Read more