Skip to main content

WorldCodec

Struct WorldCodec 

Source
pub struct WorldCodec { /* private fields */ }
Expand description

Stateful Titanium/P99-V62 codec for world approval and file validation.

Implementations§

Source§

impl WorldCodec

Source

pub fn new(login_info: &[u8]) -> Result<WorldCodec, Error>

Derive the initial world codec key from the exact login-info packet.

§Errors

Returns an error unless login_info has the 464-byte Titanium layout.

Source

pub fn approve(&mut self, challenge: &[u8]) -> Result<Vec<u8>, Error>

Answer the world’s approval challenge and initialize rolling state.

§Errors

Returns an error when the challenge is malformed or contains unsupported public-key values.

Source

pub fn encode_approval(&mut self, body: &mut [u8]) -> Result<(), Error>

Encode an approval body and seed the incoming manifest decoder.

§Errors

Returns an error unless body has the 272-byte approval layout.

Source

pub fn manifest(&mut self, body: &mut [u8]) -> Result<(), Error>

Decode the world manifest and seed its checksum response encoder.

§Errors

Returns an error when approval has not initialized the incoming state.

Source

pub fn file_response(&self, body: &mut [u8]) -> Result<(), Error>

Encode a world or zone file-checksum response with rolling state.

§Errors

Returns an error when no manifest has initialized the outgoing state.

Source

pub fn zone_manifest(&self, handoff: &[u8]) -> Result<Vec<u8>, Error>

Decode the file manifest embedded in a world-to-zone handoff.

§Errors

Returns an error when the handoff is too short or its digest input is too large.

Source

pub fn zone_entry(&mut self, entry: &[u8]) -> Result<(), Error>

Rekey the codec for a new zone from the zone-entry packet.

§Errors

Returns an error unless entry has the 68-byte Titanium layout.

Source

pub fn zone_spawn(&mut self, body: &[u8]) -> Result<(), Error>

Seed the zone checksum encoder from the decoded player spawn.

§Errors

Returns an error unless body has the 385-byte Titanium layout.

Trait Implementations§

Source§

impl Drop for WorldCodec

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Zeroize for WorldCodec

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V