Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aecsocket committed Aug 16, 2024
1 parent 8e355ec commit 9f72366
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/aeronet_replicon/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ use tracing::{trace, warn};
#[derive(Derivative)]
#[derivative(Debug(bound = ""), Clone(bound = ""), Default(bound = ""))]
pub struct RepliconClientPlugin<T> {
/// Interval between when the networking loop will be updated, receiving and
/// flushing packets.
pub update_interval: Duration,
#[derivative(Debug = "ignore")]
#[doc = "hidden"]
pub _phantom: PhantomData<T>,
}

impl<T> RepliconClientPlugin<T> {
/// Creates the plugin with a given tick rate, in hertz.
///
/// This should match the Replicon server's tick rate.
pub fn with_tick_rate(tick_rate: u16) -> Self {
Self {
update_interval: Duration::from_millis(1000 / u64::from(tick_rate)),
Expand Down
5 changes: 5 additions & 0 deletions crates/aeronet_replicon/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ use tracing::{debug, warn};
#[derive(Derivative)]
#[derivative(Debug(bound = ""), Clone(bound = ""), Default(bound = ""))]
pub struct RepliconServerPlugin<T> {
/// Interval between when the networking loop will be updated, receiving and
/// flushing packets.
pub update_interval: Duration,
#[derivative(Debug = "ignore")]
#[doc = "hidden"]
pub _phantom: PhantomData<T>,
}

impl<T> RepliconServerPlugin<T> {
/// Creates the plugin with a given tick rate, in hertz.
///
/// This should match the Replicon server's tick rate.
pub fn with_tick_rate(tick_rate: u16) -> Self {
Self {
update_interval: Duration::from_millis(1000 / u64::from(tick_rate)),
Expand Down

0 comments on commit 9f72366

Please sign in to comment.