bt_obex::server

Trait ObexServerHandler

Source
pub trait ObexServerHandler {
    // Required methods
    fn connect<'life0, 'async_trait>(
        &'life0 mut self,
        headers: HeaderSet,
    ) -> Pin<Box<dyn Future<Output = Result<HeaderSet, ObexOperationError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn disconnect<'life0, 'async_trait>(
        &'life0 mut self,
        headers: HeaderSet,
    ) -> Pin<Box<dyn Future<Output = HeaderSet> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_path<'life0, 'async_trait>(
        &'life0 mut self,
        headers: HeaderSet,
        backup: bool,
        create: bool,
    ) -> Pin<Box<dyn Future<Output = Result<HeaderSet, ObexOperationError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_info<'life0, 'async_trait>(
        &'life0 mut self,
        headers: HeaderSet,
    ) -> Pin<Box<dyn Future<Output = Result<HeaderSet, ObexOperationError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_data<'life0, 'async_trait>(
        &'life0 mut self,
        headers: HeaderSet,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, HeaderSet), ObexOperationError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn put<'life0, 'async_trait>(
        &'life0 mut self,
        data: Vec<u8>,
        headers: HeaderSet,
    ) -> Pin<Box<dyn Future<Output = Result<(), ObexOperationError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 mut self,
        headers: HeaderSet,
    ) -> Pin<Box<dyn Future<Output = Result<(), ObexOperationError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An interface that implements the OBEX Server role. This interface roughly corresponds to the operations defined in OBEX v1.5.

Required Methods§

Source

fn connect<'life0, 'async_trait>( &'life0 mut self, headers: HeaderSet, ) -> Pin<Box<dyn Future<Output = Result<HeaderSet, ObexOperationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A request to initiate the CONNECT operation. headers are the informational headers provided by the remote OBEX client.

Directed OBEX connections are automatically supported by the ObexServer and needn’t be handled in this response. Specifically, the ConnectionIdentifier is automatically added and shouldn’t be included here.

Returns Ok with any response headers if the CONNECT request is accepted. Returns Err with a rejection code and headers if the CONNECT request is rejected.

Source

fn disconnect<'life0, 'async_trait>( &'life0 mut self, headers: HeaderSet, ) -> Pin<Box<dyn Future<Output = HeaderSet> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A request to disconnect the OBEX connection. headers are the informational headers provided by the remote OBEX client. Returns informational headers in response to the request.

Source

fn set_path<'life0, 'async_trait>( &'life0 mut self, headers: HeaderSet, backup: bool, create: bool, ) -> Pin<Box<dyn Future<Output = Result<HeaderSet, ObexOperationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A request to set the current working folder on the device. headers are the informational headers provided by the remote OBEX client. If backup is true, then the remote requests to backup one directory before setting the path. If create is true, then the remote requests to create the path if it does not exist. If create is false and the path doesn’t exist, Err should be returned. Returns Ok with any response headers if the SET_PATH request is accepted. Returns Err with a rejection code and headers if the SET_PATH request is rejected.

Source

fn get_info<'life0, 'async_trait>( &'life0 mut self, headers: HeaderSet, ) -> Pin<Box<dyn Future<Output = Result<HeaderSet, ObexOperationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A request to get information about a data payload from the local OBEX server. headers are the headers provided by the remote OBEX client that specify the desired information. Returns Ok with headers if accepted. Returns Err with a rejection code and optional headers if rejected.

Source

fn get_data<'life0, 'async_trait>( &'life0 mut self, headers: HeaderSet, ) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, HeaderSet), ObexOperationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A request to get data from the local OBEX server. headers are the informational headers provided by the remote OBEX client that identify the payload to be retrieved. Returns Ok with the payload and optional informational headers if accepted. Returns Err with a rejection code and optional headers if rejected.

Source

fn put<'life0, 'async_trait>( &'life0 mut self, data: Vec<u8>, headers: HeaderSet, ) -> Pin<Box<dyn Future<Output = Result<(), ObexOperationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A request to put data in the local OBEX server. data is the payload to be written. headers are the informational headers provided by the remote OBEX client that describe the payload. Returns Ok if accepted. Returns Err with a rejection code and optional headers if rejected.

Source

fn delete<'life0, 'async_trait>( &'life0 mut self, headers: HeaderSet, ) -> Pin<Box<dyn Future<Output = Result<(), ObexOperationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A request to delete data in the local OBEX server. headers are the informational headers provided by the remote OBEX client that describe the delete request. Returns Ok if accepted. Returns Err with a rejection code and optional headers if rejected.

Implementors§