pub struct Host {
pub stop_tx: Sender<Option<Instant>>,
pub stop_rx: Receiver<Option<Instant>>,
/* private fields */
}Expand description
wasmCloud Host Represents the core host structure for managing components, providers, links, and other functionalities in a wasmCloud host environment.
Fields§
§stop_tx: Sender<Option<Instant>>A channel to send a stop event to the host, signaling it to shut down.
stop_rx: Receiver<Option<Instant>>A channel to receive a stop event from the host, signaling it to shut down.
Implementations§
Source§impl Host
impl Host
Trait Implementations§
Source§impl ControlInterfaceServer for Host
impl ControlInterfaceServer for Host
Source§fn handle_link_put<'life0, 'async_trait>(
&'life0 self,
request: Link,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_link_put<'life0, 'async_trait>(
&'life0 self,
request: Link,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a new link by modifying the relevant source crate::wasmbus::ComponentSpecification.
Source§fn handle_link_del<'life0, 'async_trait>(
&'life0 self,
request: DeleteInterfaceLinkDefinitionRequest,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_link_del<'life0, 'async_trait>(
&'life0 self,
request: DeleteInterfaceLinkDefinitionRequest,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove an interface link on a source component for a specific package
Source§fn handle_auction_component<'life0, 'async_trait>(
&'life0 self,
request: ComponentAuctionRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<CtlResponse<ComponentAuctionAck>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_auction_component<'life0, 'async_trait>(
&'life0 self,
request: ComponentAuctionRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<CtlResponse<ComponentAuctionAck>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an auction request for a component. This method should return
Ok(None) if the host
does not want to respond to the auction request.Source§fn handle_auction_provider<'life0, 'async_trait>(
&'life0 self,
request: ProviderAuctionRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<CtlResponse<ProviderAuctionAck>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_auction_provider<'life0, 'async_trait>(
&'life0 self,
request: ProviderAuctionRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<CtlResponse<ProviderAuctionAck>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an auction request for a provider. This method should return
Ok(None) if the host
does not want to respond to the auction request.Source§fn handle_stop_host<'life0, 'async_trait>(
&'life0 self,
request: StopHostCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_stop_host<'life0, 'async_trait>(
&'life0 self,
request: StopHostCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request to stop the host. This method should return a response indicating success
or failure.
Source§fn handle_scale_component<'async_trait>(
self: Arc<Self>,
request: ScaleComponentCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
fn handle_scale_component<'async_trait>(
self: Arc<Self>,
request: ScaleComponentCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
Handle a request to scale a component. This method should return a response indicating success
or failure.
Source§fn handle_update_component<'async_trait>(
self: Arc<Self>,
request: UpdateComponentCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
fn handle_update_component<'async_trait>(
self: Arc<Self>,
request: UpdateComponentCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
Handle a request to update a component. This method should return a response indicating success
or failure.
Source§fn handle_start_provider<'async_trait>(
self: Arc<Self>,
request: StartProviderCommand,
) -> Pin<Box<dyn Future<Output = Result<Option<CtlResponse<()>>>> + Send + 'async_trait>>where
Self: 'async_trait,
fn handle_start_provider<'async_trait>(
self: Arc<Self>,
request: StartProviderCommand,
) -> Pin<Box<dyn Future<Output = Result<Option<CtlResponse<()>>>> + Send + 'async_trait>>where
Self: 'async_trait,
Handle a request to start a provider. This method should return a response indicating success
or failure.
Source§fn handle_stop_provider<'life0, 'async_trait>(
&'life0 self,
request: StopProviderCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_stop_provider<'life0, 'async_trait>(
&'life0 self,
request: StopProviderCommand,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request to stop a provider. This method should return a response indicating success
or failure.
Source§fn handle_inventory<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<HostInventory>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_inventory<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<HostInventory>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request to get the host inventory. This method should return a response containing
the host inventory.
Source§fn handle_claims<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<Vec<HashMap<String, String>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_claims<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<Vec<HashMap<String, String>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request to get the claims for all components and providers. This method should return
a response containing the claims.
Source§fn handle_links<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_links<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request to get the links for all components. This method should return a response containing
the links.
Source§fn handle_config_get<'life0, 'life1, 'async_trait>(
&'life0 self,
config_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_config_get<'life0, 'life1, 'async_trait>(
&'life0 self,
config_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a request to get the configuration for a specific key. This method should return a response
containing the configuration.
Source§fn handle_config_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
config_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_config_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
config_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a request to delete the configuration for a specific key. This method should return a response
indicating success or failure.
Source§fn handle_label_put<'life0, 'life1, 'async_trait>(
&'life0 self,
request: HostLabel,
host_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_label_put<'life0, 'life1, 'async_trait>(
&'life0 self,
request: HostLabel,
host_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a request to put a label on the host. This method should return a response indicating success
or failure.
Source§fn handle_label_del<'life0, 'life1, 'async_trait>(
&'life0 self,
request: HostLabelIdentifier,
host_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_label_del<'life0, 'life1, 'async_trait>(
&'life0 self,
request: HostLabelIdentifier,
host_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a request to delete a label from the host. This method should return a response indicating success
or failure.
Source§fn handle_registries_put<'life0, 'async_trait>(
&'life0 self,
request: HashMap<String, RegistryCredential>,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_registries_put<'life0, 'async_trait>(
&'life0 self,
request: HashMap<String, RegistryCredential>,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request to put registry credentials. This method should return a response indicating success
or failure.
Source§fn handle_config_put<'life0, 'life1, 'async_trait>(
&'life0 self,
config_name: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_config_put<'life0, 'life1, 'async_trait>(
&'life0 self,
config_name: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<()>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a request to put configuration data. This method should return a response indicating success
or failure.
Source§fn handle_ping_hosts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<Host>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_ping_hosts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CtlResponse<Host>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a request to ping all hosts in the lattice. This method should return a response containing
the host data.
Auto Trait Implementations§
impl !Freeze for Host
impl !RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin for Host
impl !UnwindSafe for Host
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
Mutably borrows from an owned value. Read more
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::RequestSource§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>
Wrap the input message
T in a tonic::Request