Skip to main content

BitBrokerMessage

Struct BitBrokerMessage 

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

Implementations§

Source§

impl BitBrokerMessage

Source

pub fn new(opcode: u8, operand: u8, body: Vec<u8>) -> Self

Source

pub fn new_proto<B>(opcode: u8, operand: u8, body: B) -> Self
where B: Message,

Source

pub fn initial_game_message() -> Self

Source

pub fn initial_bot_message() -> Self

Source

pub fn bot_info_message(name: impl ToString) -> Self

Source

pub fn termination_message() -> Self

Source

pub fn trigger_message() -> Self

Source

pub fn opcode(&self) -> &u8

Source

pub fn operand(&self) -> &u8

Source

pub fn codes(&self) -> (&u8, &u8)

Source

pub fn body(&self) -> &[u8]

Source

pub fn body_proto<B>(&self) -> Result<B>
where B: Message + Default,

Trait Implementations§

Source§

impl AsRef<[u8]> for BitBrokerMessage

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<S> From<Action<S>> for BitBrokerMessage
where S: Into<Vec<u8>>,

Source§

fn from(value: Action<S>) -> Self

Converts to this type from the input type.
Source§

impl From<BitBrokerMessage> for Error

Source§

fn from(value: BitBrokerMessage) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for BitBrokerMessage

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.

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, 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, 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.