pub enum WireVariant {
Number(f64),
Int(i64),
Bool(bool),
Object(Option<usize>),
Exec,
Vector(Vector3f),
Rotator {
pitch: f64,
yaw: f64,
roll: f64,
},
Quat {
x: f64,
y: f64,
z: f64,
w: f64,
},
Str(String),
LinearColor {
r: f32,
g: f32,
b: f32,
a: f32,
},
}Expand description
A wire graph variant value. The members mirror the engine’s
WireGraphVariant union (f64, i64, bool, weak_object,
WireGraphExec, Vector, Rotator, Quat, str, LinearColor);
WireGraphPrimMathVariant uses the numeric/spatial subset.
Variants§
Number(f64)
Int(i64)
Bool(bool)
Object(Option<usize>)
weak_object member: an object/asset reference, stored as an index into
global_data.external_asset_references (None is a null reference).
Exec
Vector(Vector3f)
Vector member (X, Y, Z).
Rotator
Rotator member (Pitch, Yaw, Roll — f64 degrees).
Quat
Quat member (X, Y, Z, W — f64).
Str(String)
str member: a string value.
LinearColor
LinearColor member (R, G, B, A — f32, linear 0–1).
Trait Implementations§
Source§impl AsBrdbValue for WireVariant
impl AsBrdbValue for WireVariant
fn as_brdb_wire_variant(&self) -> Result<WireVariant, BrdbSchemaError>
fn as_brdb_bool(&self) -> Result<bool, BrdbSchemaError>
fn as_brdb_u8(&self) -> Result<u8, BrdbSchemaError>
fn as_brdb_u16(&self) -> Result<u16, BrdbSchemaError>
fn as_brdb_u32(&self) -> Result<u32, BrdbSchemaError>
fn as_brdb_u64(&self) -> Result<u64, BrdbSchemaError>
fn as_brdb_i8(&self) -> Result<i8, BrdbSchemaError>
fn as_brdb_i16(&self) -> Result<i16, BrdbSchemaError>
fn as_brdb_i32(&self) -> Result<i32, BrdbSchemaError>
fn as_brdb_i64(&self) -> Result<i64, BrdbSchemaError>
fn as_brdb_f32(&self) -> Result<f32, BrdbSchemaError>
fn as_brdb_f64(&self) -> Result<f64, BrdbSchemaError>
fn as_brdb_str(&self) -> Result<&str, BrdbSchemaError>
fn as_brdb_asset( &self, _schema: &BrdbSchema, _ty: &str, ) -> Result<Option<usize>, BrdbSchemaError>
fn as_brdb_enum( &self, _schema: &BrdbSchema, _def: &BrdbSchemaEnum, ) -> Result<i32, BrdbSchemaError>
fn as_brdb_wire_array_variant( &self, ) -> Result<WireArrayVariant, BrdbSchemaError>
fn as_brdb_wire_map_variant(&self) -> Result<WireMapVariant, BrdbSchemaError>
Source§fn as_brdb_variant_member(&self) -> Option<&str>
fn as_brdb_variant_member(&self) -> Option<&str>
When this value should encode as a named member of a schema
variant
(a tagged union whose members are structs, e.g. BRInventoryEntryVariant
-> BRInventoryEntryNothing), return the member struct’s name. The
writer emits uint(tag) + <that struct>. None (the default) means
“not a struct-member variant” and the writer falls back to the wire
map/array/scalar variant paths.Source§fn has_brdb_struct_prop(
&self,
_schema: &BrdbSchema,
_struct_name: BrdbInterned,
_prop_name: BrdbInterned,
) -> bool
fn has_brdb_struct_prop( &self, _schema: &BrdbSchema, _struct_name: BrdbInterned, _prop_name: BrdbInterned, ) -> bool
Cheap presence probe for a struct property. When this returns
false, the schema writer takes the default/zero path directly
instead of paying for a MissingStructField error (two String
allocations) per unset field. Implementations that can’t answer
cheaply keep the default true; the writer then falls back to
the erroring accessors below.Source§fn as_brdb_struct_prop_value(
&self,
_schema: &BrdbSchema,
_struct_name: BrdbInterned,
_prop_name: BrdbInterned,
) -> Result<&dyn AsBrdbValue, BrdbSchemaError>
fn as_brdb_struct_prop_value( &self, _schema: &BrdbSchema, _struct_name: BrdbInterned, _prop_name: BrdbInterned, ) -> Result<&dyn AsBrdbValue, BrdbSchemaError>
Read a specific struct property value from the schema.
Source§fn as_brdb_struct_prop_array(
&self,
_schema: &BrdbSchema,
_struct_name: BrdbInterned,
_prop_name: BrdbInterned,
) -> Result<BrdbArrayIter<'_>, BrdbSchemaError>
fn as_brdb_struct_prop_array( &self, _schema: &BrdbSchema, _struct_name: BrdbInterned, _prop_name: BrdbInterned, ) -> Result<BrdbArrayIter<'_>, BrdbSchemaError>
Get the the number of entries in a struct property.
Source§fn as_brdb_struct_prop_map(
&self,
_schema: &BrdbSchema,
_struct_name: BrdbInterned,
_prop_name: BrdbInterned,
) -> Result<BrdbMapIter<'_>, BrdbSchemaError>
fn as_brdb_struct_prop_map( &self, _schema: &BrdbSchema, _struct_name: BrdbInterned, _prop_name: BrdbInterned, ) -> Result<BrdbMapIter<'_>, BrdbSchemaError>
Get the the number of entries in a struct property.
Source§impl Clone for WireVariant
impl Clone for WireVariant
Source§fn clone(&self) -> WireVariant
fn clone(&self) -> WireVariant
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WireVariant
impl Debug for WireVariant
Source§impl Default for WireVariant
impl Default for WireVariant
Source§impl Display for WireVariant
impl Display for WireVariant
Source§impl From<&str> for WireVariant
impl From<&str> for WireVariant
Source§impl From<String> for WireVariant
impl From<String> for WireVariant
Source§impl From<Vector3f> for WireVariant
impl From<Vector3f> for WireVariant
Source§impl From<WireMapKeyData> for WireVariant
impl From<WireMapKeyData> for WireVariant
Source§fn from(k: WireMapKeyData) -> Self
fn from(k: WireMapKeyData) -> Self
Converts to this type from the input type.
Source§impl From<WireMapValueData> for WireVariant
impl From<WireMapValueData> for WireVariant
Source§fn from(v: WireMapValueData) -> Self
fn from(v: WireMapValueData) -> Self
Converts to this type from the input type.
Source§impl From<WireVariant> for WireMapValueData
impl From<WireVariant> for WireMapValueData
Source§fn from(v: WireVariant) -> Self
fn from(v: WireVariant) -> Self
Converts to this type from the input type.
Source§impl From<WireVariant> for WireMapKeyData
impl From<WireVariant> for WireMapKeyData
Source§fn from(v: WireVariant) -> Self
fn from(v: WireVariant) -> Self
Converts to this type from the input type.
Source§impl From<bool> for WireVariant
impl From<bool> for WireVariant
Source§impl From<f32> for WireVariant
impl From<f32> for WireVariant
Source§impl From<f64> for WireVariant
impl From<f64> for WireVariant
Source§impl From<i8> for WireVariant
impl From<i8> for WireVariant
Source§impl From<i16> for WireVariant
impl From<i16> for WireVariant
Source§impl From<i32> for WireVariant
impl From<i32> for WireVariant
Source§impl From<i64> for WireVariant
impl From<i64> for WireVariant
Source§impl From<u8> for WireVariant
impl From<u8> for WireVariant
Source§impl From<u16> for WireVariant
impl From<u16> for WireVariant
Source§impl From<u32> for WireVariant
impl From<u32> for WireVariant
Source§impl From<u64> for WireVariant
impl From<u64> for WireVariant
Source§impl TryFrom<&BrdbValue> for WireVariant
Convert a decoded value back into a WireVariant. Named variants decode to
raw BrdbValues (the tag is consumed on read); legacy variants decode to a
WireVar. Both round-trip here.
impl TryFrom<&BrdbValue> for WireVariant
Convert a decoded value back into a WireVariant. Named variants decode to
raw BrdbValues (the tag is consumed on read); legacy variants decode to a
WireVar. Both round-trip here.
Auto Trait Implementations§
impl Freeze for WireVariant
impl RefUnwindSafe for WireVariant
impl Send for WireVariant
impl Sync for WireVariant
impl Unpin for WireVariant
impl UnsafeUnpin for WireVariant
impl UnwindSafe for WireVariant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more