Enum Packet

Source
#[non_exhaustive]
pub enum Packet {
Show 69 variants Isi(Isi), Ver(Ver), Tiny(Tiny), Small(Small), Sta(Sta), Sch(Sch), Sfp(Sfp), Scc(Scc), Cpp(Cpp), Ism(Ism), Mso(Mso), Iii(Iii), Mst(Mst), Mtc(Mtc), Mod(Mod), Vtn(Vtn), Rst(Rst), Ncn(Ncn), Cnl(Cnl), Cpr(Cpr), Npl(Npl), Plp(Plp), Pll(Pll), Lap(Lap), Spx(Spx), Pit(Pit), Psf(Psf), Pla(Pla), Cch(Cch), Pen(Pen), Toc(Toc), Flg(Flg), Pfl(Pfl), Fin(Fin), Res(Res), Reo(Reo), Nlp(Nlp), Mci(Mci), Msx(Msx), Msl(Msl), Crs(Crs), Bfn(Bfn), Axi(Axi), Axo(Axo), Btn(Btn), Btc(Btc), Btt(Btt), Rip(Rip), Ssh(Ssh), Con(Con), Obh(Obh), Hlv(Hlv), Plc(Plc), Axm(Axm), Acr(Acr), Hcp(Hcp), Nci(Nci), Jrr(Jrr), Uco(Uco), Oco(Oco), Ttc(Ttc), Slc(Slc), Csc(Csc), Cim(Cim), Mal(Mal), Plh(Plh), Ipb(Ipb), Aic(Aic), Aii(Aii),
}
Expand description

Enum representing all possible packets receivable via an Insim connection. Each variant may either be instructional (tell LFS to do something), informational (you are told something about LFS), or both.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Isi(Isi)

Instruction - handshake or init

§

Ver(Ver)

Information - version info

§

Tiny(Tiny)

Both - multi-purpose

§

Small(Small)

Both - multi-purpose

§

Sta(Sta)

Information - State info

§

Sch(Sch)

Instruction - Single character

§

Sfp(Sfp)

Instruction - State Flags Pack

§

Scc(Scc)

Both - Set Car Cam

§

Cpp(Cpp)

Both - Camera position pack

§

Ism(Ism)

Information - Start multiplayer

§

Mso(Mso)

Information - Message out

§

Iii(Iii)

Information - Hidden /i message

§

Mst(Mst)

Instruction - Type a message or /command

§

Mtc(Mtc)

Instruction - Message to connection

§

Mod(Mod)

Instruction - set screen mode

§

Vtn(Vtn)

Information - Vote notification

§

Rst(Rst)

Information - Race start

§

Ncn(Ncn)

Information - New connection

§

Cnl(Cnl)

Information - Connection left

§

Cpr(Cpr)

Information - Connection renamed

§

Npl(Npl)

Information - New player (player joined)

§

Plp(Plp)

Information - Player telepits

§

Pll(Pll)

Information - Player left

§

Lap(Lap)

Information - Lap time

§

Spx(Spx)

Information - Split time

§

Pit(Pit)

Information - Pit stop start

§

Psf(Psf)

Information - Pit stop finish

§

Pla(Pla)

Information - Player entered pit lane

§

Cch(Cch)

Information - Camera changed

§

Pen(Pen)

Information - Penalty

§

Toc(Toc)

Information - Take over

§

Flg(Flg)

Information - Flag

§

Pfl(Pfl)

Information - Player flags

§

Fin(Fin)

Information - Finished race - unverified result

§

Res(Res)

Information - Verified finish result

§

Reo(Reo)

Both - Player reorder

§

Nlp(Nlp)

Information - Node and lap

§

Mci(Mci)

Information - Multi-car info

§

Msx(Msx)

Instruction - Type a message

§

Msl(Msl)

Instruction - Message to local computer

§

Crs(Crs)

Information - Car reset

§

Bfn(Bfn)

Both - Delete or receive buttons

§

Axi(Axi)

Information - AutoX layout info

§

Axo(Axo)

Information - Player hit an AutoX object

§

Btn(Btn)

Instruction - Show a button

§

Btc(Btc)

Information - Button clicked

§

Btt(Btt)

Information - Button was typed into

§

Rip(Rip)

Both - Replay information

§

Ssh(Ssh)

Both - screenshot

§

Con(Con)

Information - contact between vehicles

§

Obh(Obh)

Information - Object hit

§

Hlv(Hlv)

Information - Hot lap validity violation

§

Plc(Plc)

Instruction - Restrict player vehicles

§

Axm(Axm)

Both - AutoX - multiple object

§

Acr(Acr)

Information - Admin command report

§

Hcp(Hcp)

Instruction - Handicap

§

Nci(Nci)

Information - New connection information

§

Jrr(Jrr)

Instruction - Join reply response

§

Uco(Uco)

Information - report insim checkpoint/circle

§

Oco(Oco)

Instruction - Object control

§

Ttc(Ttc)

Instruction - Multi-purpose, target to connection

§

Slc(Slc)

Information - Player selected vehicle

§

Csc(Csc)

Information - Vehicle changed state

§

Cim(Cim)

Information - Connection interface mode

§

Mal(Mal)

Both - Set mods a player is allowed

§

Plh(Plh)

Both - Set/receive player handicap

§

Ipb(Ipb)

Both - Set/receive player bans

§

Aic(Aic)

Instruction - Set AI control value

§

Aii(Aii)

Information - AI information

Implementations§

Source§

impl Packet

Source

pub fn size_hint(&self) -> usize

Hint at the possible minimum size of a packet, so that when we encode it, it can pre-allocate a ballpark buffer. It must not be trusted. An incorrect implementation of size_hint() should not lead to memory safety violations.

Trait Implementations§

Source§

impl Clone for Packet

Source§

fn clone(&self) -> Packet

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Packet

Source§

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

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

impl Decode for Packet

Source§

fn decode(buf: &mut Bytes) -> Result<Self, DecodeError>

Read
Source§

impl Default for Packet

Source§

fn default() -> Self

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

impl Encode for Packet

Source§

fn encode(&self, buf: &mut BytesMut) -> Result<(), EncodeError>

Write
Source§

impl From<Acr> for Packet

Convert into Acr variant.

Source§

fn from(v: Acr) -> Self

Converts to this type from the input type.
Source§

impl From<Aic> for Packet

Convert into Aic variant.

Source§

fn from(v: Aic) -> Self

Converts to this type from the input type.
Source§

impl From<Aii> for Packet

Convert into Aii variant.

Source§

fn from(v: Aii) -> Self

Converts to this type from the input type.
Source§

impl From<Axi> for Packet

Convert into Axi variant.

Source§

fn from(v: Axi) -> Self

Converts to this type from the input type.
Source§

impl From<Axm> for Packet

Convert into Axm variant.

Source§

fn from(v: Axm) -> Self

Converts to this type from the input type.
Source§

impl From<Axo> for Packet

Convert into Axo variant.

Source§

fn from(v: Axo) -> Self

Converts to this type from the input type.
Source§

impl From<Bfn> for Packet

Convert into Bfn variant.

Source§

fn from(v: Bfn) -> Self

Converts to this type from the input type.
Source§

impl From<Btc> for Packet

Convert into Btc variant.

Source§

fn from(v: Btc) -> Self

Converts to this type from the input type.
Source§

impl From<Btn> for Packet

Convert into Btn variant.

Source§

fn from(v: Btn) -> Self

Converts to this type from the input type.
Source§

impl From<Btt> for Packet

Convert into Btt variant.

Source§

fn from(v: Btt) -> Self

Converts to this type from the input type.
Source§

impl From<Cch> for Packet

Convert into Cch variant.

Source§

fn from(v: Cch) -> Self

Converts to this type from the input type.
Source§

impl From<Cim> for Packet

Convert into Cim variant.

Source§

fn from(v: Cim) -> Self

Converts to this type from the input type.
Source§

impl From<Cnl> for Packet

Convert into Cnl variant.

Source§

fn from(v: Cnl) -> Self

Converts to this type from the input type.
Source§

impl From<Con> for Packet

Convert into Con variant.

Source§

fn from(v: Con) -> Self

Converts to this type from the input type.
Source§

impl From<Cpp> for Packet

Convert into Cpp variant.

Source§

fn from(v: Cpp) -> Self

Converts to this type from the input type.
Source§

impl From<Cpr> for Packet

Convert into Cpr variant.

Source§

fn from(v: Cpr) -> Self

Converts to this type from the input type.
Source§

impl From<Crs> for Packet

Convert into Crs variant.

Source§

fn from(v: Crs) -> Self

Converts to this type from the input type.
Source§

impl From<Csc> for Packet

Convert into Csc variant.

Source§

fn from(v: Csc) -> Self

Converts to this type from the input type.
Source§

impl From<Fin> for Packet

Convert into Fin variant.

Source§

fn from(v: Fin) -> Self

Converts to this type from the input type.
Source§

impl From<Flg> for Packet

Convert into Flg variant.

Source§

fn from(v: Flg) -> Self

Converts to this type from the input type.
Source§

impl From<Hcp> for Packet

Convert into Hcp variant.

Source§

fn from(v: Hcp) -> Self

Converts to this type from the input type.
Source§

impl From<Hlv> for Packet

Convert into Hlv variant.

Source§

fn from(v: Hlv) -> Self

Converts to this type from the input type.
Source§

impl From<Iii> for Packet

Convert into Iii variant.

Source§

fn from(v: Iii) -> Self

Converts to this type from the input type.
Source§

impl From<Ipb> for Packet

Convert into Ipb variant.

Source§

fn from(v: Ipb) -> Self

Converts to this type from the input type.
Source§

impl From<Isi> for Packet

Convert into Isi variant.

Source§

fn from(v: Isi) -> Self

Converts to this type from the input type.
Source§

impl From<Ism> for Packet

Convert into Ism variant.

Source§

fn from(v: Ism) -> Self

Converts to this type from the input type.
Source§

impl From<Jrr> for Packet

Convert into Jrr variant.

Source§

fn from(v: Jrr) -> Self

Converts to this type from the input type.
Source§

impl From<Lap> for Packet

Convert into Lap variant.

Source§

fn from(v: Lap) -> Self

Converts to this type from the input type.
Source§

impl From<LclFlags> for Packet

Source§

fn from(value: LclFlags) -> Self

Converts to this type from the input type.
Source§

impl From<LcsFlags> for Packet

Source§

fn from(value: LcsFlags) -> Self

Converts to this type from the input type.
Source§

impl From<Mal> for Packet

Convert into Mal variant.

Source§

fn from(v: Mal) -> Self

Converts to this type from the input type.
Source§

impl From<Mci> for Packet

Convert into Mci variant.

Source§

fn from(v: Mci) -> Self

Converts to this type from the input type.
Source§

impl From<Mod> for Packet

Convert into Mod variant.

Source§

fn from(v: Mod) -> Self

Converts to this type from the input type.
Source§

impl From<Msl> for Packet

Convert into Msl variant.

Source§

fn from(v: Msl) -> Self

Converts to this type from the input type.
Source§

impl From<Mso> for Packet

Convert into Mso variant.

Source§

fn from(v: Mso) -> Self

Converts to this type from the input type.
Source§

impl From<Mst> for Packet

Convert into Mst variant.

Source§

fn from(v: Mst) -> Self

Converts to this type from the input type.
Source§

impl From<Msx> for Packet

Convert into Msx variant.

Source§

fn from(v: Msx) -> Self

Converts to this type from the input type.
Source§

impl From<Mtc> for Packet

Convert into Mtc variant.

Source§

fn from(v: Mtc) -> Self

Converts to this type from the input type.
Source§

impl From<Nci> for Packet

Convert into Nci variant.

Source§

fn from(v: Nci) -> Self

Converts to this type from the input type.
Source§

impl From<Ncn> for Packet

Convert into Ncn variant.

Source§

fn from(v: Ncn) -> Self

Converts to this type from the input type.
Source§

impl From<Nlp> for Packet

Convert into Nlp variant.

Source§

fn from(v: Nlp) -> Self

Converts to this type from the input type.
Source§

impl From<Npl> for Packet

Convert into Npl variant.

Source§

fn from(v: Npl) -> Self

Converts to this type from the input type.
Source§

impl From<Obh> for Packet

Convert into Obh variant.

Source§

fn from(v: Obh) -> Self

Converts to this type from the input type.
Source§

impl From<Oco> for Packet

Convert into Oco variant.

Source§

fn from(v: Oco) -> Self

Converts to this type from the input type.
Source§

impl From<Pen> for Packet

Convert into Pen variant.

Source§

fn from(v: Pen) -> Self

Converts to this type from the input type.
Source§

impl From<Pfl> for Packet

Convert into Pfl variant.

Source§

fn from(v: Pfl) -> Self

Converts to this type from the input type.
Source§

impl From<Pit> for Packet

Convert into Pit variant.

Source§

fn from(v: Pit) -> Self

Converts to this type from the input type.
Source§

impl From<Pla> for Packet

Convert into Pla variant.

Source§

fn from(v: Pla) -> Self

Converts to this type from the input type.
Source§

impl From<Plc> for Packet

Convert into Plc variant.

Source§

fn from(v: Plc) -> Self

Converts to this type from the input type.
Source§

impl From<PlcAllowedCarsSet> for Packet

Source§

fn from(value: PlcAllowedCarsSet) -> Self

Converts to this type from the input type.
Source§

impl From<Plh> for Packet

Convert into Plh variant.

Source§

fn from(v: Plh) -> Self

Converts to this type from the input type.
Source§

impl From<Pll> for Packet

Convert into Pll variant.

Source§

fn from(v: Pll) -> Self

Converts to this type from the input type.
Source§

impl From<Plp> for Packet

Convert into Plp variant.

Source§

fn from(v: Plp) -> Self

Converts to this type from the input type.
Source§

impl From<Psf> for Packet

Convert into Psf variant.

Source§

fn from(v: Psf) -> Self

Converts to this type from the input type.
Source§

impl From<Reo> for Packet

Convert into Reo variant.

Source§

fn from(v: Reo) -> Self

Converts to this type from the input type.
Source§

impl From<Res> for Packet

Convert into Res variant.

Source§

fn from(v: Res) -> Self

Converts to this type from the input type.
Source§

impl From<Rip> for Packet

Convert into Rip variant.

Source§

fn from(v: Rip) -> Self

Converts to this type from the input type.
Source§

impl From<Rst> for Packet

Convert into Rst variant.

Source§

fn from(v: Rst) -> Self

Converts to this type from the input type.
Source§

impl From<Scc> for Packet

Convert into Scc variant.

Source§

fn from(v: Scc) -> Self

Converts to this type from the input type.
Source§

impl From<Sch> for Packet

Convert into Sch variant.

Source§

fn from(v: Sch) -> Self

Converts to this type from the input type.
Source§

impl From<Sfp> for Packet

Convert into Sfp variant.

Source§

fn from(v: Sfp) -> Self

Converts to this type from the input type.
Source§

impl From<Slc> for Packet

Convert into Slc variant.

Source§

fn from(v: Slc) -> Self

Converts to this type from the input type.
Source§

impl From<Small> for Packet

Convert into Small variant.

Source§

fn from(v: Small) -> Self

Converts to this type from the input type.
Source§

impl From<SmallType> for Packet

Source§

fn from(value: SmallType) -> Self

Converts to this type from the input type.
Source§

impl From<Spx> for Packet

Convert into Spx variant.

Source§

fn from(v: Spx) -> Self

Converts to this type from the input type.
Source§

impl From<Ssh> for Packet

Convert into Ssh variant.

Source§

fn from(v: Ssh) -> Self

Converts to this type from the input type.
Source§

impl From<Sta> for Packet

Convert into Sta variant.

Source§

fn from(v: Sta) -> Self

Converts to this type from the input type.
Source§

impl From<Tiny> for Packet

Convert into Tiny variant.

Source§

fn from(v: Tiny) -> Self

Converts to this type from the input type.
Source§

impl From<TinyType> for Packet

Source§

fn from(value: TinyType) -> Self

Converts to this type from the input type.
Source§

impl From<Toc> for Packet

Convert into Toc variant.

Source§

fn from(v: Toc) -> Self

Converts to this type from the input type.
Source§

impl From<Ttc> for Packet

Convert into Ttc variant.

Source§

fn from(v: Ttc) -> Self

Converts to this type from the input type.
Source§

impl From<TtcType> for Packet

Source§

fn from(value: TtcType) -> Self

Converts to this type from the input type.
Source§

impl From<Uco> for Packet

Convert into Uco variant.

Source§

fn from(v: Uco) -> Self

Converts to this type from the input type.
Source§

impl From<Ver> for Packet

Convert into Ver variant.

Source§

fn from(v: Ver) -> Self

Converts to this type from the input type.
Source§

impl From<Vtn> for Packet

Convert into Vtn variant.

Source§

fn from(v: Vtn) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Packet

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl WithRequestId for Packet

Source§

fn with_request_id<R: Into<RequestId>>( self, reqi: R, ) -> impl Into<Packet> + Debug

Convert something into a Packet with a request identifier

Auto Trait Implementations§

§

impl Freeze for Packet

§

impl RefUnwindSafe for Packet

§

impl Send for Packet

§

impl Sync for Packet

§

impl Unpin for Packet

§

impl UnwindSafe for Packet

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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