citadel_sdk::prelude

Trait Remote

pub trait Remote<R>: Clone + Send
where R: Ratchet,
{ // Required methods fn send_with_custom_ticket<'life0, 'async_trait>( &'life0 self, ticket: Ticket, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn send_callback_subscription<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<KernelStreamSubscription<R>, NetworkError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn account_manager(&self) -> &AccountManager<R, R>; fn get_next_ticket(&self) -> Ticket; // Provided method fn send<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<Ticket, NetworkError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } }

Required Methods§

fn send_with_custom_ticket<'life0, 'async_trait>( &'life0 self, ticket: Ticket, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Sends a request to the server with a custom ticket.

fn send_callback_subscription<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<KernelStreamSubscription<R>, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Sends a request to the server and returns a subscription for callback events.

fn account_manager(&self) -> &AccountManager<R, R>

Returns the account manager instance.

fn get_next_ticket(&self) -> Ticket

Returns the next available ticket.

Provided Methods§

fn send<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<Ticket, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Sends a request to the server and returns a ticket for tracking the response.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl<'a, R, T> Remote<R> for &'a T
where R: Ratchet, T: 'a + Remote<R> + Sync + ?Sized, &'a T: Clone + Send,

§

fn send<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<Ticket, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'a T: Sync + 'async_trait,

§

fn send_with_custom_ticket<'life0, 'async_trait>( &'life0 self, ticket: Ticket, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'a T: 'async_trait,

§

fn send_callback_subscription<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<KernelStreamSubscription<R>, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'a T: 'async_trait,

§

fn account_manager(&self) -> &AccountManager<R, R>

§

fn get_next_ticket(&self) -> Ticket

§

impl<'a, R, T> Remote<R> for &'a mut T
where R: Ratchet, T: 'a + Remote<R> + Sync + ?Sized, &'a mut T: Clone + Send,

§

fn send<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<Ticket, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'a mut T: Sync + 'async_trait,

§

fn send_with_custom_ticket<'life0, 'async_trait>( &'life0 self, ticket: Ticket, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'a mut T: 'async_trait,

§

fn send_callback_subscription<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<KernelStreamSubscription<R>, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'a mut T: 'async_trait,

§

fn account_manager(&self) -> &AccountManager<R, R>

§

fn get_next_ticket(&self) -> Ticket

§

impl<R, T> Remote<R> for Box<T>
where R: Ratchet, T: Remote<R> + Sync + ?Sized, Box<T>: Clone + Send,

§

fn send<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<Ticket, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<T>: Sync + 'async_trait,

§

fn send_with_custom_ticket<'life0, 'async_trait>( &'life0 self, ticket: Ticket, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<T>: 'async_trait,

§

fn send_callback_subscription<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<KernelStreamSubscription<R>, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<T>: 'async_trait,

§

fn account_manager(&self) -> &AccountManager<R, R>

§

fn get_next_ticket(&self) -> Ticket

§

impl<R, T> Remote<R> for Arc<T>
where R: Ratchet, T: Remote<R> + Sync + ?Sized, Arc<T>: Clone + Send,

§

fn send<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<Ticket, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: Sync + 'async_trait,

§

fn send_with_custom_ticket<'life0, 'async_trait>( &'life0 self, ticket: Ticket, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

§

fn send_callback_subscription<'life0, 'async_trait>( &'life0 self, request: NodeRequest, ) -> Pin<Box<dyn Future<Output = Result<KernelStreamSubscription<R>, NetworkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

§

fn account_manager(&self) -> &AccountManager<R, R>

§

fn get_next_ticket(&self) -> Ticket

Implementors§

§

impl<R> Remote<R> for NodeRemote<R>
where R: Ratchet,

Source§

impl<R: Ratchet> Remote<R> for ClientServerRemote<R>