pub struct SwiftError { /* private fields */ }Expand description
A Swift Error box, owned.
What throw produces and catch receives: a refcounted box holding a value
and the Error conformance that describes it. Rust can make one, which is
how a Rust callback answers a Swift API that wants a failure.
Implementations§
Source§impl SwiftError
impl SwiftError
Sourcepub unsafe fn new(
value: *const c_void,
meta: *const c_void,
wt: *const c_void,
) -> Self
pub unsafe fn new( value: *const c_void, meta: *const c_void, wt: *const c_void, ) -> Self
Box a value as an Error.
§Safety
value must address an initialised value of meta’s type, and wt must
be that type’s Error conformance. The value is copied into the box, so
the caller keeps its own.
Sourcepub fn as_ptr(&self) -> *mut c_void
pub fn as_ptr(&self) -> *mut c_void
The box, for handing to Swift.
Borrowed: Swift is expected to retain it if it keeps it.
Sourcepub fn payload_type_name(&self) -> String
pub fn payload_type_name(&self) -> String
The type of the value inside, as the runtime spells it.
Read back out of the box rather than remembered, which is what makes this
a check on swift_allocError rather than an echo of its argument.
Trait Implementations§
Source§impl Clone for SwiftError
impl Clone for SwiftError
Source§impl Drop for SwiftError
impl Drop for SwiftError
Auto Trait Implementations§
impl !Send for SwiftError
impl !Sync for SwiftError
impl Freeze for SwiftError
impl RefUnwindSafe for SwiftError
impl Unpin for SwiftError
impl UnsafeUnpin for SwiftError
impl UnwindSafe for SwiftError
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