/// Represents types that can be converted to/from an [`EncodeArgument`] type. /// /// This is implemented specially for [`bool`] to allow using that as /// Objective-C `BOOL`, where it would otherwise not be allowed (since they /// are not ABI compatible). /// /// This is also done specially for `&mut Retained<_>`-like arguments, to /// allow using those as "out" / pass-by-writeback parameters. pubtrait ConvertArgument: argument_private::Sealed { /// The inner type that this can be converted to and from. #[doc(hidden)] type __Inner: EncodeArgument;
/// A helper type for out parameters. /// /// When dropped, this will process any necessary change to the /// parameters. #[doc(hidden)] type __WritebackOnDrop: Sized;
/// # Safety /// /// The `__WritebackOnDrop` return type must not be leaked, and the /// `__Inner` pointer must not be used after the `__WritebackOnDrop` has /// dropped. /// /// NOTE: The standard way to ensure such a thing is with closures, but /// using those would interact poorly with backtraces of the message send, /// so we're forced to ensure this out of band. #[doc(hidden)] unsafefn __into_argument(self) -> (Self::__Inner, Self::__WritebackOnDrop);
}
// Implemented in writeback.rs impl<T: Message> argument_private::Sealed for &mut Retained<T> {} impl<T: Message> argument_private::Sealed for Option<&mut Retained<T>> {} impl<T: Message> argument_private::Sealed for &mut Option<Retained<T>> {} impl<T: Message> argument_private::Sealed for Option<&mut Option<Retained<T>>> {}
impl<T: EncodeArgument> argument_private::Sealed for T {} impl<T: EncodeArgument> ConvertArgument for T { type __Inner = Self;
/// Same as [`ConvertArgument`], but for return types. /// /// See `RetainSemantics` for more details. pubtrait ConvertReturn<MethodFamily>: return_private::Sealed { type Inner: EncodeReturn;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.