/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! FfiDefault trait //! //! When we make a FFI call into Rust we always need to return a value, even if that value will be //! ignored because we're flagging an exception. This trait defines what that value is for our //! supported FFI types.
use paste::paste;
pubtrait FfiDefault { fn ffi_default() -> Self;
}
// Most types can be handled by delegating to Default
macro_rules! impl_ffi_default_with_default {
($($T:ty,)+) => { impl_ffi_default_with_default!($($T),+); };
($($T:ty),*) => {
$(
paste! { impl FfiDefault for $T { fn ffi_default() -> Self {
$T::default()
}
}
}
)*
};
}
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.