Struct amethyst_network::NetSocketSystem
source · pub struct NetSocketSystem<E: 'static>where
E: PartialEq,{
pub filters: Vec<Box<dyn NetFilter<E>>>,
/* private fields */
}
Expand description
The System managing the network state and connections. The T generic parameter corresponds to the network event type. Receives events and filters them. Received events will be inserted into the NetReceiveBuffer resource. To send an event, add it to the NetSendBuffer resource.
If both a connection (Connect or Connected) event is received at the same time as another event from the same connection, only the connection event will be considered and rest will be filtered out.
Fields
filters: Vec<Box<dyn NetFilter<E>>>
The list of filters applied on the events received.
Implementations
Trait Implementations
sourceimpl<'a, E> System<'a> for NetSocketSystem<E>where
E: Send + Sync + Serialize + Clone + DeserializeOwned + PartialEq + 'static,
impl<'a, E> System<'a> for NetSocketSystem<E>where
E: Send + Sync + Serialize + Clone + DeserializeOwned + PartialEq + 'static,
type SystemData = Storage<'a, NetConnection<E>, FetchMut<'a, MaskedStorage<NetConnection<E>>>>
type SystemData = Storage<'a, NetConnection<E>, FetchMut<'a, MaskedStorage<NetConnection<E>>>>
The resource bundle required to execute this system. Read more
sourcefn run(&mut self, net_connections: Self::SystemData)
fn run(&mut self, net_connections: Self::SystemData)
Executes the system with the required system
data. Read more
sourcefn running_time(&self) -> RunningTime
fn running_time(&self) -> RunningTime
Returns a hint how long the system needs for running.
This is used to optimize the way they’re executed (might
allow more parallelization). Read more
sourcefn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self>
fn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self>
Return the accessor from the
SystemData
.Auto Trait Implementations
impl<E> !RefUnwindSafe for NetSocketSystem<E>
impl<E> Send for NetSocketSystem<E>where
E: Send,
impl<E> !Sync for NetSocketSystem<E>
impl<E> Unpin for NetSocketSystem<E>
impl<E> !UnwindSafe for NetSocketSystem<E>
Blanket Implementations
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<'a, T> RunWithPool<'a> for Twhere
T: System<'a>,
impl<'a, T> RunWithPool<'a> for Twhere
T: System<'a>,
sourcefn run(&mut self, res: &'a Resources, _: &ThreadPool)
fn run(&mut self, res: &'a Resources, _: &ThreadPool)
Runs the system/group of systems. Possibly in parallel depending
on how the structure is set up. Read more
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
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 morefn 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).unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.