pub struct OtsClient { /* private fields */ }
Expand description
Object Transfer Service (OTS) client
Implementations§
Source§impl OtsClient
impl OtsClient
Sourcepub async fn new(
session: &BluetoothSession,
device_id: &DeviceId,
config: &ClientConfig,
) -> Result<Self>
pub async fn new( session: &BluetoothSession, device_id: &DeviceId, config: &ClientConfig, ) -> Result<Self>
Create new client instance
Sourcepub fn action_features(&self) -> &ActionFeature
pub fn action_features(&self) -> &ActionFeature
Get object action feature flags
Sourcepub fn list_features(&self) -> &ListFeature
pub fn list_features(&self) -> &ListFeature
Get object list feature flags
Sourcepub async fn first_created(&self) -> Result<Option<DateTime>>
pub async fn first_created(&self) -> Result<Option<DateTime>>
Get first created time for selected object
Sourcepub async fn last_modified(&self) -> Result<Option<DateTime>>
pub async fn last_modified(&self) -> Result<Option<DateTime>>
Get last modified time for selected object
Sourcepub async fn properties(&self) -> Result<Property>
pub async fn properties(&self) -> Result<Property>
Get current object properties
Sourcepub async fn previous(&self) -> Result<bool>
pub async fn previous(&self) -> Result<bool>
Select previous object
Returns false
if current object is first.
Sourcepub async fn next(&self) -> Result<bool>
pub async fn next(&self) -> Result<bool>
Select next object
Returns false
if current object is last.
Sourcepub async fn go_to(&self, id: u64) -> Result<bool>
pub async fn go_to(&self, id: u64) -> Result<bool>
Select object by identifier
Returns false
if object nor found.
Sourcepub async fn read(
&self,
offset: usize,
length: Option<usize>,
) -> Result<Vec<u8>>
pub async fn read( &self, offset: usize, length: Option<usize>, ) -> Result<Vec<u8>>
Read object data
Sourcepub async fn read_to(&self, offset: usize, buffer: &mut [u8]) -> Result<usize>
pub async fn read_to(&self, offset: usize, buffer: &mut [u8]) -> Result<usize>
Read object data
Sourcepub async fn read_stream(
&self,
offset: usize,
length: Option<usize>,
) -> Result<Stream>
pub async fn read_stream( &self, offset: usize, length: Option<usize>, ) -> Result<Stream>
Read object data
Trait Implementations§
Source§impl AsRef<ActionFeature> for OtsClient
impl AsRef<ActionFeature> for OtsClient
Source§fn as_ref(&self) -> &ActionFeature
fn as_ref(&self) -> &ActionFeature
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<BluetoothSession> for OtsClient
impl AsRef<BluetoothSession> for OtsClient
Source§fn as_ref(&self) -> &BluetoothSession
fn as_ref(&self) -> &BluetoothSession
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<ListFeature> for OtsClient
impl AsRef<ListFeature> for OtsClient
Source§fn as_ref(&self) -> &ListFeature
fn as_ref(&self) -> &ListFeature
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl Freeze for OtsClient
impl !RefUnwindSafe for OtsClient
impl Send for OtsClient
impl Sync for OtsClient
impl Unpin for OtsClient
impl !UnwindSafe for OtsClient
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