pub trait Mirror: Sized + 'static {
type View<'a>: From<Row<'a, Self>>;
type Writer<'w>: From<RowWriter<'w, Self>>;
const NAME: &'static str;
const OWNER: Option<&'static str>;
const SPACE: &'static str;
const ALL: u64;
const FAMILY: bool = false;
const CLOCK: Clock = Clock::Server;
// Required methods
fn fields() -> Vec<FieldSpec>;
fn read(row: &Row<'_, Self>) -> Self;
fn write(&self, row: &mut RowWriter<'_, Self>);
// Provided methods
fn address() -> String { ... }
fn spec() -> MirrorSpec { ... }
fn declare(fields: u64, rate: Rate) -> Result<Mirrored<Self>, Diagnostic> { ... }
fn declare_scoped<S: Schema>(
scope: &S,
fields: u64,
rate: Rate,
) -> Result<Mirrored<Self>, Diagnostic> { ... }
fn declare_in<S: Schema>(
member: &str,
scope: Option<&S>,
fields: u64,
rate: Rate,
) -> Result<Mirrored<Self>, Diagnostic> { ... }
}Expand description
A mirror’s row type (#[yog_mirror] implements it).
Required Associated Constants§
Provided Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
fn spec() -> MirrorSpec
Sourcefn declare(fields: u64, rate: Rate) -> Result<Mirrored<Self>, Diagnostic>
fn declare(fields: u64, rate: Rate) -> Result<Mirrored<Self>, Diagnostic>
Asks for fields (its bit consts or-ed) at rate.
Sourcefn declare_scoped<S: Schema>(
scope: &S,
fields: u64,
rate: Rate,
) -> Result<Mirrored<Self>, Diagnostic>
fn declare_scoped<S: Schema>( scope: &S, fields: u64, rate: Rate, ) -> Result<Mirrored<Self>, Diagnostic>
Mirror::declare covering scope (its scope type: a
BlockScope…) — a mirror that isn’t a family’s.
Sourcefn declare_in<S: Schema>(
member: &str,
scope: Option<&S>,
fields: u64,
rate: Rate,
) -> Result<Mirrored<Self>, Diagnostic>
fn declare_in<S: Schema>( member: &str, scope: Option<&S>, fields: u64, rate: Rate, ) -> Result<Mirrored<Self>, Diagnostic>
Mirror::declare in member member of its family (a dimension:
minecraft:overworld), covering scope (its scope type: a
BlockScope…).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".