[][src]Trait basws_server::ServerLogic

pub trait ServerLogic: Send + Sync {
    type Request: Serialize + DeserializeOwned + Clone + Send + Sync + Debug;
    type Response: Serialize + DeserializeOwned + Clone + Send + Sync + Debug;
    type Account: Identifiable<Id = Self::AccountId> + Serialize + DeserializeOwned + Send + Sync + Debug;
    type AccountId: Copy + Hash + Eq + Send + Sync;
#[must_use]    fn handle_request<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        client: &'life1 ConnectedClient<Self::Response, Self::Account>,
        request: Self::Request,
        server: &'life2 Server<Self>
    ) -> Pin<Box<dyn Future<Output = Result<RequestHandling<Self::Response>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn lookup_account_from_installation_id<'life0, 'async_trait>(
        &'life0 self,
        installation_id: Uuid
    ) -> Pin<Box<dyn Future<Output = Result<Option<Handle<Self::Account>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn protocol_version_requirements(&self) -> VersionReq;
#[must_use] fn lookup_or_create_installation<'life0, 'async_trait>(
        &'life0 self,
        installation_id: Option<Uuid>
    ) -> Pin<Box<dyn Future<Output = Result<InstallationConfig>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn client_reconnected<'life0, 'async_trait>(
        &'life0 self,
        installation_id: Uuid,
        account: Option<Handle<Self::Account>>
    ) -> Pin<Box<dyn Future<Output = Result<RequestHandling<Self::Response>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn new_installation_connected<'life0, 'async_trait>(
        &'life0 self,
        installation_id: Uuid
    ) -> Pin<Box<dyn Future<Output = Result<RequestHandling<Self::Response>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; #[must_use] fn handle_websocket_error<'life0, 'async_trait>(
        &'life0 self,
        _err: Error
    ) -> Pin<Box<dyn Future<Output = ErrorHandling> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } }

Associated Types

Loading content...

Required methods

#[must_use]fn handle_request<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    client: &'life1 ConnectedClient<Self::Response, Self::Account>,
    request: Self::Request,
    server: &'life2 Server<Self>
) -> Pin<Box<dyn Future<Output = Result<RequestHandling<Self::Response>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn lookup_account_from_installation_id<'life0, 'async_trait>(
    &'life0 self,
    installation_id: Uuid
) -> Pin<Box<dyn Future<Output = Result<Option<Handle<Self::Account>>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

fn protocol_version_requirements(&self) -> VersionReq

#[must_use]fn lookup_or_create_installation<'life0, 'async_trait>(
    &'life0 self,
    installation_id: Option<Uuid>
) -> Pin<Box<dyn Future<Output = Result<InstallationConfig>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn client_reconnected<'life0, 'async_trait>(
    &'life0 self,
    installation_id: Uuid,
    account: Option<Handle<Self::Account>>
) -> Pin<Box<dyn Future<Output = Result<RequestHandling<Self::Response>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn new_installation_connected<'life0, 'async_trait>(
    &'life0 self,
    installation_id: Uuid
) -> Pin<Box<dyn Future<Output = Result<RequestHandling<Self::Response>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Loading content...

Provided methods

#[must_use]fn handle_websocket_error<'life0, 'async_trait>(
    &'life0 self,
    _err: Error
) -> Pin<Box<dyn Future<Output = ErrorHandling> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementors

Loading content...