[][src]Struct qt_core::QUnhandledException

#[repr(C)]pub struct QUnhandledException { /* fields omitted */ }

The UnhandledException class represents an unhandled exception in a worker thread.

C++ class: QUnhandledException.

C++ documentation:

The UnhandledException class represents an unhandled exception in a worker thread.

If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.

Inheriting from this class is not supported.

Methods

impl QUnhandledException[src]

pub unsafe fn clone(&self) -> Ptr<QUnhandledException>[src]

Calls C++ function: virtual QUnhandledException* QUnhandledException::clone() const.

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QUnhandledException>>
) -> Ref<QUnhandledException>
[src]

The UnhandledException class represents an unhandled exception in a worker thread.

Calls C++ function: QUnhandledException& QUnhandledException::operator=(const QUnhandledException& other).

C++ documentation:

The UnhandledException class represents an unhandled exception in a worker thread.

If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.

Inheriting from this class is not supported.

pub unsafe fn new() -> CppBox<QUnhandledException>[src]

The UnhandledException class represents an unhandled exception in a worker thread.

Calls C++ function: [constructor] void QUnhandledException::QUnhandledException().

C++ documentation:

The UnhandledException class represents an unhandled exception in a worker thread.

If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.

Inheriting from this class is not supported.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QUnhandledException>>
) -> CppBox<QUnhandledException>
[src]

The UnhandledException class represents an unhandled exception in a worker thread.

Calls C++ function: [constructor] void QUnhandledException::QUnhandledException(const QUnhandledException& other).

C++ documentation:

The UnhandledException class represents an unhandled exception in a worker thread.

If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.

Inheriting from this class is not supported.

pub unsafe fn raise(&self)[src]

Calls C++ function: virtual void QUnhandledException::raise() const.

Methods from Deref<Target = QException>

pub unsafe fn clone(&self) -> Ptr<QException>[src]

In your QException subclass, reimplement clone() like this:

Calls C++ function: virtual QException* QException::clone() const.

C++ documentation:

In your QException subclass, reimplement clone() like this:


  MyException *MyException::clone() const { return new MyException(*this); }

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QException>>
) -> Ref<QException>
[src]

Qt Concurrent supports throwing and catching exceptions across thread boundaries, provided that the exception inherit from QException and implement two helper functions:

Calls C++ function: QException& QException::operator=(const QException& other).

C++ documentation:

Qt Concurrent supports throwing and catching exceptions across thread boundaries, provided that the exception inherit from QException and implement two helper functions:

  class MyException : public QException
  {
  public:
      void raise() const override { throw *this; }
      MyException *clone() const override { return new MyException(*this); }
  };

QException subclasses must be thrown by value and caught by reference:

  try  {
      QtConcurrent::blockingMap(list, throwFunction); // throwFunction throws MyException
  } catch (MyException &e) {
      // handle exception
  }

If you throw an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException in the receiver thread.

When using QFuture, transferred exceptions will be thrown when calling the following functions:

pub unsafe fn raise(&self)[src]

In your QException subclass, reimplement raise() like this:

Calls C++ function: virtual void QException::raise() const.

C++ documentation:

In your QException subclass, reimplement raise() like this:


  void MyException::raise() const { throw *this; }

Trait Implementations

impl CppDeletable for QUnhandledException[src]

unsafe fn delete(&self)[src]

Destroys the instance of QUnhandledException. The destructor is virtual.

Calls C++ function: virtual [destructor] void QUnhandledException::~QUnhandledException().

C++ documentation:

Destroys the instance of QUnhandledException. The destructor is virtual.

impl Deref for QUnhandledException[src]

type Target = QException

The resulting type after dereferencing.

fn deref(&self) -> &QException[src]

Calls C++ function: QException* static_cast<QException*>(QUnhandledException* ptr).

impl DynamicCast<QUnhandledException> for QException[src]

unsafe fn dynamic_cast(ptr: Ptr<QException>) -> Ptr<QUnhandledException>[src]

Calls C++ function: QUnhandledException* dynamic_cast<QUnhandledException*>(QException* ptr).

impl StaticDowncast<QUnhandledException> for QException[src]

unsafe fn static_downcast(ptr: Ptr<QException>) -> Ptr<QUnhandledException>[src]

Calls C++ function: QUnhandledException* static_cast<QUnhandledException*>(QException* ptr).

impl StaticUpcast<QException> for QUnhandledException[src]

unsafe fn static_upcast(ptr: Ptr<QUnhandledException>) -> Ptr<QException>[src]

Calls C++ function: QException* static_cast<QException*>(QUnhandledException* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.