pub struct RenetClientVisualizer<const N: usize> { /* private fields */ }Expand description
Egui visualizer for the renet client. Draws graphs with metrics: RTT, Packet Loss, Kbitps Sent/Received.
N: determines how many values are shown in the graph. 200 is a good value, if updated at 60 fps the graphs would hold 3 seconds of data.
Implementations§
Source§impl<const N: usize> RenetClientVisualizer<N>
impl<const N: usize> RenetClientVisualizer<N>
pub fn new(style: RenetVisualizerStyle) -> Self
Sourcepub fn add_network_info(&mut self, network_info: NetworkInfo)
pub fn add_network_info(&mut self, network_info: NetworkInfo)
Add the network information from the client. Should be called every time the client updates.
§Usage
client.update(delta);
visualizer.add_network_info(client.network_info());Sourcepub fn show_window(&self, ctx: &Context)
pub fn show_window(&self, ctx: &Context)
Renders a new window with all the graphs metrics drawn.
Sourcepub fn draw_received_kbps(&self, ui: &mut Ui)
pub fn draw_received_kbps(&self, ui: &mut Ui)
Draws only the Received Kilobits Per Second metric.
Sourcepub fn draw_sent_kbps(&self, ui: &mut Ui)
pub fn draw_sent_kbps(&self, ui: &mut Ui)
Draws only the Sent Kilobits Per Second metric.
Sourcepub fn draw_packet_loss(&self, ui: &mut Ui)
pub fn draw_packet_loss(&self, ui: &mut Ui)
Draws only the Packet Loss metric.
Trait Implementations§
Source§impl<const N: usize> Default for RenetClientVisualizer<N>
impl<const N: usize> Default for RenetClientVisualizer<N>
impl<const N: usize> Resource for RenetClientVisualizer<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for RenetClientVisualizer<N>
impl<const N: usize> RefUnwindSafe for RenetClientVisualizer<N>
impl<const N: usize> Send for RenetClientVisualizer<N>
impl<const N: usize> Sync for RenetClientVisualizer<N>
impl<const N: usize> Unpin for RenetClientVisualizer<N>
impl<const N: usize> UnwindSafe for RenetClientVisualizer<N>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.