Struct XmlSerializer

Source
pub struct XmlSerializer { /* private fields */ }

Trait Implementations§

Source§

impl Debug for XmlSerializer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for XmlSerializer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl SerializeFlags for &mut XmlSerializer

Source§

fn serialize_empty_bit(&mut self) -> Result<(), Self::Error>

e.g. 0

Source§

type Ok = ()

Must match the Ok type of our Serializer.
Source§

type Error = Error

Must match the Error type of our Serializer.
Source§

fn serialize_field<T>( &mut self, key: &str, _value: &T, ) -> Result<(), Self::Error>
where T: ?Sized + Serialize,

Serialize a enum or bit field.(Only used by XML serializer.)
Source§

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing flags.
Source§

fn serialize_bits<T>(&mut self, value: &T) -> Result<(), Self::Error>
where T: Serialize + ?Sized,

Serialize all bits of a flag.(Only used by binary serializer.) Read more
Source§

impl SerializeSeq for &mut XmlSerializer

Source§

fn serialize_primitive_element<T>( &mut self, value: &T, index: usize, len: usize, ) -> Result<(), Self::Error>
where T: ?Sized + Serialize,

§Expected XML Examples
  • hkArray<hkInt8>(same as ptr, hkReal, etc…)
<hkparam name="key" numelements="20">
    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    16 17 18 19 20
</hkparam>
Source§

fn serialize_cstring_element(&mut self, value: &CString<'_>) -> Result<()>

§XML Examples
    <hkcstring>CString</hkcstring>
Source§

fn serialize_stringptr_element(&mut self, value: &StringPtr<'_>) -> Result<()>

§XML Examples
    <hkcstring>StringPtr</hkcstring>
Source§

type Ok = ()

Must match the Ok type of our Serializer.
Source§

type Error = Error

Must match the Error type of our Serializer.
Source§

fn serialize_class_element<T>(&mut self, value: &T) -> Result<()>
where T: ?Sized + Serialize,

Serialize a Havok Class sequence element.(e.g. T: impl HavokClass)
Source§

fn serialize_math_element<T>(&mut self, value: &T) -> Result<()>
where T: ?Sized + Serialize,

Serialize a math sequence element.(e.g. Matrix3)
Source§

fn end(self) -> Result<()>

Finish serializing a sequence.
Source§

impl SerializeStruct for &mut XmlSerializer

Source§

fn serialize_field<T>(&mut self, key: &'static str, value: &T) -> Result<()>
where T: ?Sized + Serialize,

§XML Examples
<hkparam name="key1">value</hkparam>
Source§

fn serialize_array_field<V, T>( &mut self, key: &'static str, value: V, _size: TypeSize, ) -> Result<()>
where V: AsRef<[T]> + Serialize, T: Serialize,

§XML Examples
  • hkArray<hkInt8>(same as ptr, hkReal, etc…)
<hkparam name="key" numelements="20">
    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    16 17 18 19 20
</hkparam>
  • hkArray<hkStringPtr>
<hkparam name="key" numelements="3">
    <hkcstring>StringPtr1</hkcstring>
    <hkcstring>StringPtr2</hkcstring>
    <hkcstring>StringPtr3</hkcstring>
</hkparam>
  • hkArray<Vector4>
<hkparam name="key" numelements="2">
    (0.000000 0.000000 0.000000 0.000000)
    (0.000000 0.000000 0.000000 0.000000)
</hkparam>
Source§

fn skip_field<T>(&mut self, key: &'static str, _: &T) -> Result<()>
where T: ?Sized + Serialize,

§XML Examples
<!-- key SERIALIZE_IGNORED --><!-- This is skip_field -->
<hkparam name="otherKey"></hkparam>
Source§

type Ok = ()

Must match the Ok type of our Serializer.
Source§

type Error = Error

Must match the Error type of our Serializer.
Source§

fn serialize_fixed_array_field<V, T>( &mut self, key: &'static str, value: V, size: TypeSize, ) -> Result<(), Self::Error>
where V: AsRef<[T]> + Serialize, T: Serialize,

Serialize a struct field for fixed array. Read more
Source§

fn end(self) -> Result<()>

Finish serializing a struct.
Source§

fn pad_field<T>( &mut self, x86_pads: &T, x64_pads: &T, ) -> Result<(), Self::Error>
where T: AsRef<[u8]> + ?Sized,

Processing for padding to serialize binary data Read more
Source§

fn skip_fixed_array_field<V, T>( &mut self, key: &'static str, value: V, size: TypeSize, ) -> Result<(), Self::Error>
where V: AsRef<[T]> + Serialize, T: Serialize,

Process for fields with SERIALIZE_IGNORED flag. Read more
Source§

fn skip_array_field<V, T>( &mut self, key: &'static str, value: V, size: TypeSize, ) -> Result<(), Self::Error>
where V: AsRef<[T]> + Serialize, T: Serialize,

Process for fields with SERIALIZE_IGNORED flag. Read more
Source§

impl Serializer for &mut XmlSerializer

Source§

fn serialize_struct( self, name: &'static str, class_meta: Option<(Pointer, Signature)>, _sizes: (u64, u64), ) -> Result<Self::SerializeStruct>

Create an XML string like the following

<hkobject name="#0010" class="hkbProjectData" signature="0x13a39ba7">
  <!-- memSizeAndFlags SERIALIZE_IGNORED -->
  <!-- referenceCount SERIALIZE_IGNORED -->
  <hkparam name="worldUpWS">(0.000000 0.000000 1.000000 0.000000)</hkparam>
  <hkparam name="stringData">#0009</hkparam>
  <hkparam name="defaultEventMode">EVENT_MODE_IGNORE_FROM_GENERATOR</hkparam>
</hkobject>
Source§

fn serialize_variant(self, v: &Variant) -> Result<Self::Ok>

FIXME: Unclear XML representation

Source§

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 Error = Error

The error type when some error occurs during serialization.
Source§

type SerializeSeq = &mut XmlSerializer

Type returned from serialize_seq for serializing the content of the sequence.
Source§

type SerializeStruct = &mut XmlSerializer

Source§

type SerializeFlags = &mut XmlSerializer

Type returned from serialize_enum_flags for serializing the content of the struct variant.
Source§

fn serialize_void(self, _: ()) -> Result<Self::Ok>

Serialize a Void value. Read more
Source§

fn serialize_bool(self, v: bool) -> Result<Self::Ok>

Serialize a bool value.
Source§

fn serialize_char(self, v: char) -> Result<Self::Ok>

Serialize an char value.
Source§

fn serialize_int8(self, v: i8) -> Result<Self::Ok>

Serialize an i8 value. Read more
Source§

fn serialize_uint8(self, v: u8) -> Result<Self::Ok>

Serialize an u8 value.
Source§

fn serialize_int16(self, v: i16) -> Result<Self::Ok>

Serialize an i16 value.
Source§

fn serialize_uint16(self, v: u16) -> Result<Self::Ok>

Serialize an u16 value.
Source§

fn serialize_int32(self, v: i32) -> Result<Self::Ok>

Serialize an i32 value.
Source§

fn serialize_uint32(self, v: u32) -> Result<Self::Ok>

Serialize an u32 value.
Source§

fn serialize_int64(self, v: i64) -> Result<Self::Ok>

Serialize an u64 value.
Source§

fn serialize_uint64(self, v: u64) -> Result<Self::Ok>

Serialize an i64 value.
Source§

fn serialize_real(self, v: f32) -> Result<Self::Ok>

Serialize an f32 value.
Source§

fn serialize_vector4(self, v: &Vector4) -> Result<Self::Ok>

Serialize an Vector4 value.
Source§

fn serialize_quaternion(self, v: &Quaternion) -> Result<Self::Ok>

Serialize an Quaternion value.
Source§

fn serialize_matrix3(self, v: &Matrix3) -> Result<Self::Ok>

Serialize an Matrix3 value.
Source§

fn serialize_rotation(self, v: &Rotation) -> Result<Self::Ok>

Serialize an Rotation value.
Source§

fn serialize_qstransform(self, v: &QsTransform) -> Result<Self::Ok>

Serialize an QsTransform value.
Source§

fn serialize_matrix4(self, v: &Matrix4) -> Result<Self::Ok>

Serialize an Matrix4 value.
Source§

fn serialize_transform(self, v: &Transform) -> Result<Self::Ok>

Serialize an Transform value.
Source§

fn serialize_pointer(self, v: Pointer) -> Result<Self::Ok>

Serialize an Pointer value.
Source§

fn serialize_array(self, _len: Option<usize>) -> Result<Self::SerializeSeq>

Serialize an Array value.
Source§

fn serialize_cstring(self, v: &CString<'_>) -> Result<Self::Ok>

Serialize an CString value.
Source§

fn serialize_ulong(self, v: Ulong) -> Result<Self::Ok>

Serialize an ULong(pointer size(u32 or u64)) value.
Source§

fn serialize_enum_flags(self) -> Result<Self::SerializeFlags>

Serialize an enum or Flags value.
Source§

fn serialize_half(self, v: f16) -> Result<Self::Ok>

Serialize an Half(f16) value.
Source§

fn serialize_stringptr(self, v: &StringPtr<'_>) -> Result<Self::Ok>

Serialize an StringPtr value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoResult<T> for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more