pub struct AbortController { /* private fields */ }Expand description
AbortController implementation for Rust Provides similar functionality to the JavaScript AbortController
Implementations§
Source§impl AbortController
impl AbortController
Sourcepub fn new(max_listeners: usize) -> Self
pub fn new(max_listeners: usize) -> Self
Create a new AbortController with custom max listeners
Sourcepub fn signal(&self) -> &Arc<AbortSignal> ⓘ
pub fn signal(&self) -> &Arc<AbortSignal> ⓘ
Get the abort signal
Sourcepub fn abort(&self, reason: Option<Arc<dyn Any + Send + Sync>>)
pub fn abort(&self, reason: Option<Arc<dyn Any + Send + Sync>>)
Abort the controller with an optional reason
Sourcepub fn is_aborted(&self) -> bool
pub fn is_aborted(&self) -> bool
Check if aborted
Trait Implementations§
Source§impl Clone for AbortController
impl Clone for AbortController
Auto Trait Implementations§
impl Freeze for AbortController
impl RefUnwindSafe for AbortController
impl Send for AbortController
impl Sync for AbortController
impl Unpin for AbortController
impl UnsafeUnpin for AbortController
impl UnwindSafe for AbortController
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