pub struct Extension<W: Debug + Default> {
pub info: ExtensionInfo,
pub args: Vec<String>,
pub globals: W,
/* private fields */
}Fields§
§info: ExtensionInfo§args: Vec<String>§globals: WImplementations§
Source§impl<W: Debug + Default + 'static> Extension<W>
impl<W: Debug + Default + 'static> Extension<W>
pub fn new() -> Self
pub fn run(&mut self)
pub fn get_packet_info_manager(&self) -> Option<PacketInfoManager>
pub fn get_host_info(&self) -> Option<HostInfo>
pub fn write_to_console(&self, s: String)
pub fn write_to_console_formatted(&self, s: String, colour: ConsoleColour)
pub fn on_init(&mut self, listener: fn(ext: &mut Self))
pub fn on_socket_disconnect(&mut self, listener: fn(ext: &mut Self))
pub fn on_connect( &mut self, listener: fn(ext: &mut Self, connection_info: ConnectionInfo), )
pub fn on_start(&mut self, listener: fn(ext: &mut Self))
pub fn on_end(&mut self, listener: fn(ext: &mut Self))
pub fn on_host_info_update( &mut self, listener: fn(ext: &mut Self, host_info: HostInfo), )
pub fn on_click(&mut self, listener: fn(ext: &mut Self))
pub fn request_flags( &mut self, callback: fn(ext: &mut Self, flags: Vec<String>), )
pub fn intercept<T: BaseParser + 'static>( &mut self, listener: fn(ext: &mut Self, msg: &mut HMessage, object: &mut T), )
pub fn intercept_by_id<T: BaseParser + 'static>( &mut self, id: i32, listener: fn(ext: &mut Self, msg: &mut HMessage, object: &mut T), )
pub fn intercept_raw<I: InterceptIndicator>( &mut self, direction: HDirection, indicator: I, listener: impl Fn(&mut Self, &mut HMessage) + Send + Sync + 'static, )
pub fn send_to_client(&self, packet: HPacket) -> bool
pub fn send_to_server(&self, packet: HPacket) -> bool
pub fn send<B: BaseParser>(&self, packet_object: B) -> bool
pub fn send_with_id<B: BaseParser>( &self, packet_object: B, header_id: i32, ) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for Extension<W>where
W: Freeze,
impl<W> !RefUnwindSafe for Extension<W>
impl<W> Send for Extension<W>where
W: Send,
impl<W> Sync for Extension<W>where
W: Sync,
impl<W> Unpin for Extension<W>where
W: Unpin,
impl<W> !UnwindSafe for Extension<W>
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