pub trait Default { }Expand description
Default semantics accepted by the arcis interpreter.
§Implementing
Unlike most traits accepted by the interpreter, Default is both
derivable and manually implementable inside #[encrypted] code.
Both
#[derive(Default)]
struct Foo { x: u32, y: bool }and a hand-written
impl Default for Foo {
fn default() -> Self { Foo { x: 7, y: true } }
}are accepted. For enums, the variant the derive picks is the one marked
with #[default].
§Calling
Inside #[encrypted] code, the supported forms are:
T::default().<T as Default>::default().
The unqualified trait form Default::default() is not accepted: the
interpreter does not perform return-type type inference, so it cannot
figure out which T you mean.
§Implementors
The impl list below shows the types the interpreter recognizes as having
a Default. User types with #[derive(Default)] or a hand-written
impl Default for ... are accepted at use sites but do not appear in this
list (their impls live in user code, not in arcis).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".