-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Currently:
pub struct Mdns<'a, M, R, S, RB, SB>
where
M: RawMutex,
{
ipv4_interface: Option<Ipv4Addr>,
ipv6_interface: Option<u32>,
recv: Mutex<M, R>,
send: Mutex<M, S>,
recv_buf: RB,
send_buf: SB,
rand: fn(&mut [u8]),
broadcast_signal: &'a Signal<M, ()>,
wait_readable: bool,
}why not having rand being a generic type that implement rand::RngCore ?
Something like:
pub struct Mdns<'a, M, R, S, RB, SB, RNG>
where
M: RawMutex,
RNG: rand::RngCore,
{
ipv4_interface: Option<Ipv4Addr>,
ipv6_interface: Option<u32>,
recv: Mutex<M, R>,
send: Mutex<M, S>,
recv_buf: RB,
send_buf: SB,
rand: RNG,
broadcast_signal: &'a Signal<M, ()>,
wait_readable: bool,
}because having this fonction prototype implies that the Random Number Generator need to be static and use within the fn without being passed as parameter.
bouttier
Metadata
Metadata
Assignees
Labels
No labels