pub struct AndroidWorkManager { /* private fields */ }Expand description
Android Work Manager
Implementations§
Source§impl AndroidWorkManager
impl AndroidWorkManager
Sourcepub fn new(
config: AndroidWorkManagerConfig,
mobile_config: MobileConfig,
) -> Result<Self>
pub fn new( config: AndroidWorkManagerConfig, mobile_config: MobileConfig, ) -> Result<Self>
Create new Android Work Manager
Sourcepub async fn enqueue_work(&self, work_request: WorkRequest) -> Result<String>
pub async fn enqueue_work(&self, work_request: WorkRequest) -> Result<String>
Enqueue work request
Sourcepub async fn cancel_work(&self, work_id: &str) -> Result<bool>
pub async fn cancel_work(&self, work_id: &str) -> Result<bool>
Cancel work by ID
Sourcepub fn get_work_status(&self, work_id: &str) -> Result<WorkStatus>
pub fn get_work_status(&self, work_id: &str) -> Result<WorkStatus>
Get work status
Sourcepub fn get_work_result(&self, work_id: &str) -> Result<Option<WorkResult>>
pub fn get_work_result(&self, work_id: &str) -> Result<Option<WorkResult>>
Get work result
Sourcepub fn get_work_statistics(&self) -> Result<String>
pub fn get_work_statistics(&self) -> Result<String>
Get work statistics
Sourcepub fn list_pending_work(&self) -> Result<Vec<String>>
pub fn list_pending_work(&self) -> Result<Vec<String>>
List all pending work
Sourcepub fn list_running_work(&self) -> Result<Vec<String>>
pub fn list_running_work(&self) -> Result<Vec<String>>
List all running work
Sourcepub fn cleanup_completed_work(&self, older_than_hours: f64) -> Result<usize>
pub fn cleanup_completed_work(&self, older_than_hours: f64) -> Result<usize>
Clean up completed work older than specified duration
Auto Trait Implementations§
impl !RefUnwindSafe for AndroidWorkManager
impl !UnwindSafe for AndroidWorkManager
impl Freeze for AndroidWorkManager
impl Send for AndroidWorkManager
impl Sync for AndroidWorkManager
impl Unpin for AndroidWorkManager
impl UnsafeUnpin for AndroidWorkManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more