pub struct ObexClient { /* private fields */ }
Expand description
The Client role for an OBEX session. Provides an interface for connecting to a remote OBEX server and initiating the operations specified in OBEX 1.5.
Implementations§
Source§impl ObexClient
impl ObexClient
pub fn new(channel: Channel, type_: TransportType) -> Self
pub fn is_transport_connected(&self) -> bool
pub fn is_connected(&self) -> bool
pub fn connection_id(&self) -> Option<ConnectionIdentifier>
Sourcepub async fn connect(&self, headers: HeaderSet) -> Result<HeaderSet, Error>
pub async fn connect(&self, headers: HeaderSet) -> Result<HeaderSet, Error>
Initiates a CONNECT request to the remote peer. Returns the Headers associated with the response on success. Returns Error if the CONNECT operation could not be completed.
Sourcepub async fn disconnect(self, headers: HeaderSet) -> Result<HeaderSet, Error>
pub async fn disconnect(self, headers: HeaderSet) -> Result<HeaderSet, Error>
Initiates a DISCONNECT request to the remote peer. Returns the Headers associated with the response on success. Returns Error if the DISCONNECT operation couldn’t be completed or was rejected by the peer. The OBEX Session with the peer is considered terminated, regardless.
Sourcepub fn get(&self) -> Result<GetOperation<'_>, Error>
pub fn get(&self) -> Result<GetOperation<'_>, Error>
Initializes a GET Operation to retrieve data from the remote OBEX Server.
Returns a GetOperation
on success, Error if the new operation couldn’t be started.
Sourcepub fn put(&self) -> Result<PutOperation<'_>, Error>
pub fn put(&self) -> Result<PutOperation<'_>, Error>
Initializes a PUT Operation to write data to the remote OBEX Server.
Returns a PutOperation
on success, Error if the new operation couldn’t be started.
Sourcepub async fn set_path(
&self,
flags: SetPathFlags,
headers: HeaderSet,
) -> Result<HeaderSet, Error>
pub async fn set_path( &self, flags: SetPathFlags, headers: HeaderSet, ) -> Result<HeaderSet, Error>
Initializes a SETPATH Operation to set the current folder on the remote OBEX Server.
Returns the Headers associated with the response on success.
Returns Error::NotImplemented
if the remote server does not support SETPATH.
Returns Error for all other errors.