pub struct Protocol { /* private fields */ }
Expand description
Runtime part of the runtime host protocol.
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub fn get_config(&self) -> &Config
pub fn get_config(&self) -> &Config
The supplied runtime configuration.
Sourcepub fn get_identity(&self) -> Option<&Arc<Identity>>
pub fn get_identity(&self) -> Option<&Arc<Identity>>
The runtime identity.
Sourcepub fn get_runtime_id(&self) -> Namespace
pub fn get_runtime_id(&self) -> Namespace
The runtime identifier for this instance.
§Panics
Panics, if the host environment information is not set.
Sourcepub fn get_host_info(&self) -> HostInfo
pub fn get_host_info(&self) -> HostInfo
The host environment information for this instance.
§Panics
Panics, if the host environment information is not set.
Sourcepub fn call_host(&self, body: Body) -> Result<Body, Error>
pub fn call_host(&self, body: Body) -> Result<Body, Error>
Make a new request to the runtime host and wait for the response.
This is a blocking variant of call_host_async
.
§Panics
This function panics if called within an asynchronous execution context.
Sourcepub async fn call_host_async(&self, body: Body) -> Result<Body, Error>
pub async fn call_host_async(&self, body: Body) -> Result<Body, Error>
Make a new request to the runtime host and wait for the response.
Sourcepub fn send_response(&self, id: u64, body: Body) -> Result<()>
pub fn send_response(&self, id: u64, body: Body) -> Result<()>
Send an async response to a previous request back to the host.
Sourcepub fn ensure_initialized(&self) -> Result<()>
pub fn ensure_initialized(&self) -> Result<()>
Ensure that the runtime is ready to process requests and fail otherwise.
Trait Implementations§
Source§impl BundleManager for Protocol
impl BundleManager for Protocol
Source§fn bundle_write<'life0, 'async_trait>(
&'life0 self,
args: BundleWriteRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleWriteResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bundle_write<'life0, 'async_trait>(
&'life0 self,
args: BundleWriteRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleWriteResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to host to write a chunk of the bundle to a temporary file. Read more
Source§fn bundle_add<'life0, 'async_trait>(
&'life0 self,
args: BundleAddRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleAddResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bundle_add<'life0, 'async_trait>(
&'life0 self,
args: BundleAddRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleAddResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to host to add a specific bundle to the host. Read more
Source§fn bundle_remove<'life0, 'async_trait>(
&'life0 self,
args: BundleRemoveRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleRemoveResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bundle_remove<'life0, 'async_trait>(
&'life0 self,
args: BundleRemoveRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleRemoveResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to host to remove a specific component. Only components added by this component
can be removed. Read more
Source§fn bundle_list<'life0, 'async_trait>(
&'life0 self,
args: BundleListRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bundle_list<'life0, 'async_trait>(
&'life0 self,
args: BundleListRequest,
) -> Pin<Box<dyn Future<Output = Result<BundleListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to host to list all bundles. Read more
Source§impl Host for Protocol
impl Host for Protocol
Source§fn identity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn identity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the identity of the host node.
Source§fn submit_tx<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
opts: SubmitTxOpts,
) -> Pin<Box<dyn Future<Output = Result<Option<TxResult>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_tx<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
opts: SubmitTxOpts,
) -> Pin<Box<dyn Future<Output = Result<Option<TxResult>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a transaction.
Source§fn register_notify<'life0, 'async_trait>(
&'life0 self,
opts: RegisterNotifyOpts,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_notify<'life0, 'async_trait>(
&'life0 self,
opts: RegisterNotifyOpts,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register for receiving notifications.
Source§fn bundle_manager(&self) -> &dyn BundleManager
fn bundle_manager(&self) -> &dyn BundleManager
Bundle manager interface.
Source§fn volume_manager(&self) -> &dyn VolumeManager
fn volume_manager(&self) -> &dyn VolumeManager
Volume manager interface.
Source§impl VolumeManager for Protocol
impl VolumeManager for Protocol
Source§fn volume_add<'life0, 'async_trait>(
&'life0 self,
args: VolumeAddRequest,
) -> Pin<Box<dyn Future<Output = Result<VolumeAddResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn volume_add<'life0, 'async_trait>(
&'life0 self,
args: VolumeAddRequest,
) -> Pin<Box<dyn Future<Output = Result<VolumeAddResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to host to add a volume. Read more
Source§fn volume_remove<'life0, 'async_trait>(
&'life0 self,
args: VolumeRemoveRequest,
) -> Pin<Box<dyn Future<Output = Result<VolumeRemoveResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn volume_remove<'life0, 'async_trait>(
&'life0 self,
args: VolumeRemoveRequest,
) -> Pin<Box<dyn Future<Output = Result<VolumeRemoveResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to host to remove volumes. Read more
Source§fn volume_list<'life0, 'async_trait>(
&'life0 self,
args: VolumeListRequest,
) -> Pin<Box<dyn Future<Output = Result<VolumeListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn volume_list<'life0, 'async_trait>(
&'life0 self,
args: VolumeListRequest,
) -> Pin<Box<dyn Future<Output = Result<VolumeListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to host to list volumes. Read more
Auto Trait Implementations§
impl !Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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