[−][src]Struct qt_core::QException
Qt Concurrent supports throwing and catching exceptions across thread boundaries, provided that the exception inherit from QException and implement two helper functions:
C++ class: QException
.
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:
Methods
impl QException
[src]
pub unsafe fn clone(&self) -> MutPtr<QException>
[src]
In your QException subclass, reimplement clone() like this:
Calls C++ function: virtual QException* QException::clone() const
.
In your QException subclass, reimplement clone() like this:
MyException *MyException::clone() const { return new MyException(*this); }
pub unsafe fn copy_from(
&mut self,
other: impl CastInto<Ref<QException>>
) -> MutRef<QException>
[src]
&mut self,
other: impl CastInto<Ref<QException>>
) -> MutRef<QException>
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)
.
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 new() -> CppBox<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: [constructor] void QException::QException()
.
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 new_copy(
other: impl CastInto<Ref<QException>>
) -> CppBox<QException>
[src]
other: impl CastInto<Ref<QException>>
) -> CppBox<QException>
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: [constructor] void QException::QException(const QException& other)
.
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
.
In your QException subclass, reimplement raise() like this:
void MyException::raise() const { throw *this; }
Trait Implementations
impl CppDeletable for QException
[src]
unsafe fn delete(&mut self)
[src]
Destroys the instance of QException. The destructor is virtual.
Calls C++ function: virtual [destructor] void QException::~QException()
.
Destroys the instance of QException. The destructor is virtual.
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)
.
unsafe fn dynamic_cast_mut(
ptr: MutPtr<QException>
) -> MutPtr<QUnhandledException>
[src]
ptr: MutPtr<QException>
) -> MutPtr<QUnhandledException>
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)
.
unsafe fn static_downcast_mut(
ptr: MutPtr<QException>
) -> MutPtr<QUnhandledException>
[src]
ptr: MutPtr<QException>
) -> MutPtr<QUnhandledException>
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)
.
unsafe fn static_upcast_mut(
ptr: MutPtr<QUnhandledException>
) -> MutPtr<QException>
[src]
ptr: MutPtr<QUnhandledException>
) -> MutPtr<QException>
Calls C++ function: QException* static_cast<QException*>(QUnhandledException* ptr)
.
Auto Trait Implementations
impl RefUnwindSafe for QException
impl Send for QException
impl Sync for QException
impl Unpin for QException
impl UnwindSafe for QException
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,