pub struct PhysicsStreamServer {
pub port: u16,
pub n_clients: usize,
pub frame_queue: VecDeque<ProtocolFrame>,
pub protocol: BinaryProtocol,
pub running: bool,
/* private fields */
}Expand description
Mock physics stream server.
Serves physics state frames to connected mock clients.
Fields§
§port: u16Port (mock).
n_clients: usizeNumber of connected clients.
frame_queue: VecDeque<ProtocolFrame>Frame queue for broadcasting.
protocol: BinaryProtocolProtocol encoder.
running: boolRunning flag.
Implementations§
Source§impl PhysicsStreamServer
impl PhysicsStreamServer
Sourcepub fn connect_client(&mut self)
pub fn connect_client(&mut self)
Connect a mock client.
Sourcepub fn disconnect_client(&mut self)
pub fn disconnect_client(&mut self)
Disconnect a mock client.
Sourcepub fn broadcast(&mut self, timestamp: f64, state: Vec<u8>)
pub fn broadcast(&mut self, timestamp: f64, state: Vec<u8>)
Broadcast physics state to all clients.
Sourcepub fn pop_frame(&mut self) -> Option<ProtocolFrame>
pub fn pop_frame(&mut self) -> Option<ProtocolFrame>
Get next frame from queue.
Sourcepub fn queue_depth(&self) -> usize
pub fn queue_depth(&self) -> usize
Queue depth.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PhysicsStreamServer
impl RefUnwindSafe for PhysicsStreamServer
impl Send for PhysicsStreamServer
impl Sync for PhysicsStreamServer
impl Unpin for PhysicsStreamServer
impl UnsafeUnpin for PhysicsStreamServer
impl UnwindSafe for PhysicsStreamServer
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.