pub trait SwiftArg<'a> {
type ArgType;
// Required method
unsafe fn as_arg(&'a self) -> Self::ArgType;
}
Expand description
Identifies a type as being a valid argument in a Swift function.
Required Associated Types§
Required Methods§
sourceunsafe fn as_arg(&'a self) -> Self::ArgType
unsafe fn as_arg(&'a self) -> Self::ArgType
Creates a swift-compatible version of the argument.
For primitives this just returns self
,
but for SwiftObject
types it wraps them in SwiftRef
.
This function is called within the swift!
macro.
§Safety
Creating a SwiftRef
is inherently unsafe,
but is reliable if using the swift!
macro,
so it is not advised to call this function manually.