Nui
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Nui::WebApi::AbortSignal Class Reference

#include <abort_signal.hpp>

Inheritance diagram for Nui::WebApi::AbortSignal:
Inheritance graph
[legend]
Collaboration diagram for Nui::WebApi::AbortSignal:
Collaboration graph
[legend]

Public Member Functions

 AbortSignal (Nui::val val)
 
bool aborted () const
 A Boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not (false).
 
Nui::val reason () const
 A JavaScript value providing the abort reason, once the signal has aborted.
 
void abort () const
 The AbortSignal.abort() static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
 
void abort (Nui::val reason) const
 The AbortSignal.abort() static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
 
void timeout (std::chrono::milliseconds time) const
 The AbortSignal.timeout() static method returns an AbortSignal that will automatically abort after a specified time.
 
- Public Member Functions inherited from Nui::ValWrapper
 ValWrapper (Nui::val valObject)
 
virtual ~ValWrapper ()=default
 
 ValWrapper (ValWrapper const &)=default
 
 ValWrapper (ValWrapper &&) noexcept=default
 
ValWrapperoperator= (ValWrapper const &)=default
 
ValWrapperoperator= (ValWrapper &&) noexcept=default
 
Nui::val const & val () const &noexcept
 
Nui::val val () &&noexcept
 
 operator Nui::val const & () const &noexcept
 
 operator Nui::val () &&noexcept
 

Additional Inherited Members

- Protected Attributes inherited from Nui::ValWrapper
Nui::val val_
 

Detailed Description

See also
https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal

Constructor & Destructor Documentation

◆ AbortSignal()

Nui::WebApi::AbortSignal::AbortSignal ( Nui::val  val)
explicit

Member Function Documentation

◆ abort() [1/2]

void Nui::WebApi::AbortSignal::abort ( ) const

The AbortSignal.abort() static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).

◆ abort() [2/2]

void Nui::WebApi::AbortSignal::abort ( Nui::val  reason) const

The AbortSignal.abort() static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).

Parameters
reasonThe reason why the operation was aborted, which can be any JavaScript value. If not specified, the reason is set to "AbortError" DOMException.

◆ aborted()

bool Nui::WebApi::AbortSignal::aborted ( ) const

A Boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not (false).

◆ reason()

Nui::val Nui::WebApi::AbortSignal::reason ( ) const

A JavaScript value providing the abort reason, once the signal has aborted.

◆ timeout()

void Nui::WebApi::AbortSignal::timeout ( std::chrono::milliseconds  time) const

The AbortSignal.timeout() static method returns an AbortSignal that will automatically abort after a specified time.

The signal aborts with a TimeoutError DOMException on timeout.

Parameters
timeA time to timeout on.

The documentation for this class was generated from the following files: