pub struct ByteSerializer { /* private fields */ }
Expand description
Trait Implementations§
Source§impl Debug for ByteSerializer
impl Debug for ByteSerializer
Source§impl Default for ByteSerializer
impl Default for ByteSerializer
Source§fn default() -> ByteSerializer
fn default() -> ByteSerializer
Returns the “default value” for a type. Read more
Source§impl SerializeFlags for &mut ByteSerializer
impl SerializeFlags for &mut ByteSerializer
Source§impl SerializeSeq for &mut ByteSerializer
impl SerializeSeq for &mut ByteSerializer
Source§fn serialize_class_element<T>(&mut self, value: &T) -> Result<()>
fn serialize_class_element<T>(&mut self, value: &T) -> Result<()>
This method is called on HavokClasses array.(Write start)
Therefore, it is necessary to record the write position of this in virtual_fixup.
Source§fn serialize_primitive_element<T>(
&mut self,
value: &T,
_index: usize,
_len: usize,
) -> Result<(), Self::Error>
fn serialize_primitive_element<T>( &mut self, value: &T, _index: usize, _len: usize, ) -> Result<(), Self::Error>
Source§fn serialize_math_element<T>(&mut self, value: &T) -> Result<()>
fn serialize_math_element<T>(&mut self, value: &T) -> Result<()>
Serialize a math sequence element.(e.g.
Matrix3
)Source§fn serialize_cstring_element(&mut self, value: &CString<'_>) -> Result<()>
fn serialize_cstring_element(&mut self, value: &CString<'_>) -> Result<()>
Serialize a cstring sequence element.
Source§impl<'a> Serializer for &'a mut ByteSerializer
impl<'a> Serializer for &'a mut ByteSerializer
Source§fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>
fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>
Assume that the characters are ASCII charactersc_char
. In that case, i8 is used to fit into 128 characters.
Source§fn serialize_struct(
self,
name: &'static str,
class_meta: Option<(Pointer, Signature)>,
sizes: (u64, u64),
) -> Result<Self::SerializeStruct, Self::Error>
fn serialize_struct( self, name: &'static str, class_meta: Option<(Pointer, Signature)>, sizes: (u64, u64), ) -> Result<Self::SerializeStruct, Self::Error>
This is called in the Havok Class array or HashMap, or in a serializer in a field.
Classes in the field may be inlined, in which case class_meta
will be None
.
§what’s class_meta
?
If class_meta
exists, it is when writing an hkobject
with the name
attribute in XML.
This must be written to virtual_fixup so that the constructor can be called.
Source§fn serialize_stringptr(self, v: &StringPtr<'_>) -> Result<Self::Ok, Self::Error>
fn serialize_stringptr(self, v: &StringPtr<'_>) -> Result<Self::Ok, Self::Error>
In the binary serialization of hkx, this is the actual data writing process beyond the pointer that is called only after all fields of the structure have been written.
Source§type Ok = ()
type Ok = ()
The output type produced by this
Serializer
during successful
serialization. Most serializers that produce text or binary output
should set Ok = ()
and serialize into an io::Write
or buffer
contained within the Serializer
instance. Serializers that build
in-memory data structures may be simplified by using Ok
to propagate
the data structure around.Source§type SerializeSeq = &'a mut ByteSerializer
type SerializeSeq = &'a mut ByteSerializer
Type returned from
serialize_seq
for serializing the content of the
sequence.Source§type SerializeStruct = StructSerializer<'a>
type SerializeStruct = StructSerializer<'a>
Source§type SerializeFlags = &'a mut ByteSerializer
type SerializeFlags = &'a mut ByteSerializer
Type returned from
serialize_enum_flags
for serializing the
content of the struct variant.Source§fn serialize_void(self, _: ()) -> Result<Self::Ok, Self::Error>
fn serialize_void(self, _: ()) -> Result<Self::Ok, Self::Error>
Serialize a
Void
value. Read moreSource§fn serialize_int8(self, v: i8) -> Result<Self::Ok, Self::Error>
fn serialize_int8(self, v: i8) -> Result<Self::Ok, Self::Error>
Serialize an
i8
value. Read moreSource§fn serialize_vector4(self, v: &Vector4) -> Result<Self::Ok, Self::Error>
fn serialize_vector4(self, v: &Vector4) -> Result<Self::Ok, Self::Error>
Serialize an
Vector4
value.Source§fn serialize_quaternion(self, v: &Quaternion) -> Result<Self::Ok, Self::Error>
fn serialize_quaternion(self, v: &Quaternion) -> Result<Self::Ok, Self::Error>
Serialize an
Quaternion
value.Source§fn serialize_matrix3(self, v: &Matrix3) -> Result<Self::Ok, Self::Error>
fn serialize_matrix3(self, v: &Matrix3) -> Result<Self::Ok, Self::Error>
Serialize an
Matrix3
value.Source§fn serialize_rotation(self, v: &Rotation) -> Result<Self::Ok, Self::Error>
fn serialize_rotation(self, v: &Rotation) -> Result<Self::Ok, Self::Error>
Serialize an
Rotation
value.Source§fn serialize_matrix4(self, v: &Matrix4) -> Result<Self::Ok, Self::Error>
fn serialize_matrix4(self, v: &Matrix4) -> Result<Self::Ok, Self::Error>
Serialize an
Matrix4
value.Source§fn serialize_qstransform(self, v: &QsTransform) -> Result<Self::Ok, Self::Error>
fn serialize_qstransform(self, v: &QsTransform) -> Result<Self::Ok, Self::Error>
Serialize an
QsTransform
value.Source§fn serialize_transform(self, v: &Transform) -> Result<Self::Ok, Self::Error>
fn serialize_transform(self, v: &Transform) -> Result<Self::Ok, Self::Error>
Serialize an
Transform
value.Source§fn serialize_pointer(self, ptr: Pointer) -> Result<Self::Ok, Self::Error>
fn serialize_pointer(self, ptr: Pointer) -> Result<Self::Ok, Self::Error>
Serialize an
Pointer
value.Source§fn serialize_array(
self,
_len: Option<usize>,
) -> Result<Self::SerializeSeq, Self::Error>
fn serialize_array( self, _len: Option<usize>, ) -> Result<Self::SerializeSeq, Self::Error>
Serialize an
Array
value.Source§fn serialize_variant(self, v: &Variant) -> Result<Self::Ok, Self::Error>
fn serialize_variant(self, v: &Variant) -> Result<Self::Ok, Self::Error>
Serialize an
Variant
value. Read moreSource§fn serialize_cstring(self, v: &CString<'_>) -> Result<Self::Ok, Self::Error>
fn serialize_cstring(self, v: &CString<'_>) -> Result<Self::Ok, Self::Error>
Serialize an
CString
value.Source§fn serialize_ulong(self, v: Ulong) -> Result<Self::Ok, Self::Error>
fn serialize_ulong(self, v: Ulong) -> Result<Self::Ok, Self::Error>
Serialize an
ULong
(pointer size(u32 or u64)) value.Source§fn serialize_enum_flags(self) -> Result<Self::SerializeFlags, Self::Error>
fn serialize_enum_flags(self) -> Result<Self::SerializeFlags, Self::Error>
Serialize an
enum
or Flags
value.Auto Trait Implementations§
impl Freeze for ByteSerializer
impl RefUnwindSafe for ByteSerializer
impl Send for ByteSerializer
impl Sync for ByteSerializer
impl Unpin for ByteSerializer
impl UnwindSafe for ByteSerializer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more