pub struct Service { /* private fields */ }
Implementations§
Source§impl Service
impl Service
Sourcepub fn with_config(self, config: ServiceConfiguration) -> Self
pub fn with_config(self, config: ServiceConfiguration) -> Self
Set the configuration of the service
Sourcepub fn with_message_processor(
self,
message_processor: Arc<MessageProcessor>,
) -> Self
pub fn with_message_processor( self, message_processor: Arc<MessageProcessor>, ) -> Self
Set the message processor of the service
Sourcepub fn config(&self) -> &ServiceConfiguration
pub fn config(&self) -> &ServiceConfiguration
get the service configuration
Sourcepub fn signal(self) -> Signal
pub fn signal(self) -> Signal
get signal used to shutdown the service NOTE: this method consumes the service!
Sourcepub async fn run(&mut self) -> Result<(), ServiceError>
pub async fn run(&mut self) -> Result<(), ServiceError>
Run the service
pub async fn create_agent( &self, agent_name: &Agent, ) -> Result<AppChannelReceiver, ServiceError>
pub async fn delete_agent(&self, agent_name: &Agent) -> Result<(), ServiceError>
pub fn run_server(&self, config: &ServerConfig) -> Result<(), ServiceError>
pub fn stop_server(&self, endpoint: &str) -> Result<(), ServiceError>
pub async fn connect(&self, config: &ClientConfig) -> Result<u64, ServiceError>
pub fn disconnect(&self, conn: u64) -> Result<(), ServiceError>
pub fn get_connection_id(&self, endpoint: &str) -> Option<u64>
pub async fn subscribe( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: Option<u64>, ) -> Result<(), ServiceError>
pub async fn unsubscribe( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: Option<u64>, ) -> Result<(), ServiceError>
pub async fn set_route( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: u64, ) -> Result<(), ServiceError>
pub async fn remove_route( &self, local_agent: &Agent, agent_type: &AgentType, agent_id: Option<u64>, conn: u64, ) -> Result<(), ServiceError>
pub async fn publish_to( &self, source: &Agent, session_info: Info, agent_type: &AgentType, agent_id: Option<u64>, forward_to: u64, blob: Vec<u8>, ) -> Result<(), ServiceError>
pub async fn publish( &self, source: &Agent, session_info: Info, agent_type: &AgentType, agent_id: Option<u64>, blob: Vec<u8>, ) -> Result<(), ServiceError>
pub async fn publish_with_flags( &self, source: &Agent, session_info: Info, agent_type: &AgentType, agent_id: Option<u64>, flags: AgpHeaderFlags, blob: Vec<u8>, ) -> Result<(), ServiceError>
Sourcepub async fn create_session(
&self,
agent: &Agent,
session_config: SessionConfig,
) -> Result<Info, ServiceError>
pub async fn create_session( &self, agent: &Agent, session_config: SessionConfig, ) -> Result<Info, ServiceError>
Create a new session
Sourcepub async fn set_session_config(
&self,
agent: &Agent,
session_config: &SessionConfig,
session_id: Option<Id>,
) -> Result<(), ServiceError>
pub async fn set_session_config( &self, agent: &Agent, session_config: &SessionConfig, session_id: Option<Id>, ) -> Result<(), ServiceError>
Set config for a session
Sourcepub async fn get_session_config(
&self,
agent: &Agent,
session_id: Id,
) -> Result<SessionConfig, ServiceError>
pub async fn get_session_config( &self, agent: &Agent, session_id: Id, ) -> Result<SessionConfig, ServiceError>
Get config for a session
Sourcepub async fn get_default_session_config(
&self,
agent: &Agent,
session_type: SessionType,
) -> Result<SessionConfig, ServiceError>
pub async fn get_default_session_config( &self, agent: &Agent, session_type: SessionType, ) -> Result<SessionConfig, ServiceError>
Get default session config
Sourcepub async fn delete_session(
&self,
agent: &Agent,
session_id: Id,
) -> Result<(), ServiceError>
pub async fn delete_session( &self, agent: &Agent, session_id: Id, ) -> Result<(), ServiceError>
delete a session
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Service
impl !RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl Unpin for Service
impl !UnwindSafe for Service
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
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> 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
Source§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