Trait bevy_pigeon::app::AppExt
source · [−]pub trait AppExt {
fn sync_comp<T, M>(
&mut self,
table: &mut MsgTable,
transport: Transport
) -> &mut Self
where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned;
fn try_sync_comp<T, M>(
&mut self,
table: &mut MsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError>
where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned;
fn sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> &mut Self
where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned;
fn try_sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError>
where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned;
}
Expand description
An extension trait for easy registering NetComp
types.
Required Methods
Adds everything needed to sync component T
using message type M
.
Registers the type NetCompMsg<M>
into table
and adds the system required to sync
components of type T
, using type M
to send.
Types T
and M
can be the same type; if the component T
implements all the
required traits, you may use it as M
.
Panics
panics if NetCompMsg<M>
is already registered in the table
(If you call this method twice with the same M
).
Adds everything needed to sync component T
using message type M
.
Same as sync_comp()
, but doesn’t panic in the event of a MsgRegError
.
fn sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> &mut Self where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
fn sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> &mut Self where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
Adds everything needed to sync component T
using message type M
.
Registers the type NetCompMsg<M>
into table
and adds the system required to sync
components of type T
, using type M
to send.
Types T
and M
can be the same type; if the component T
implements all the
required traits, you may use it as M
.
Panics
panics if NetCompMsg<M>
is already registered in the table
(If you call this method twice with the same M
).
fn try_sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError> where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
fn try_sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError> where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
Adds everything needed to sync component T
using message type M
.
Same as sync_comp()
, but doesn’t panic in the event of a MsgRegError
.
Implementations on Foreign Types
sourceimpl AppExt for App
impl AppExt for App
sourcefn sync_comp<T, M>(
&mut self,
table: &mut MsgTable,
transport: Transport
) -> &mut Self where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
fn sync_comp<T, M>(
&mut self,
table: &mut MsgTable,
transport: Transport
) -> &mut Self where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
Adds everything needed to sync component T
using message type M
.
Registers the type NetCompMsg<M>
into table
and adds the system required to sync
components of type T
, using type M
to send.
Types T
and M
can be the same type; if the component T
implements all the
required traits, you may use it as M
.
Panics
panics if NetCompMsg<M>
is already registered in the table
(If you call this method twice with the same M
).
sourcefn try_sync_comp<T, M>(
&mut self,
table: &mut MsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError> where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
fn try_sync_comp<T, M>(
&mut self,
table: &mut MsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError> where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
Adds everything needed to sync component T
using message type M
.
Same as sync_comp()
, but doesn’t panic in the event of a MsgRegError
.
sourcefn sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> &mut Self where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
fn sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> &mut Self where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
Adds everything needed to sync component T
using message type M
.
Registers the type NetCompMsg<M>
into table
and adds the system required to sync
components of type T
, using type M
to send.
Types T
and M
can be the same type; if the component T
implements all the
required traits, you may use it as M
.
Panics
panics if NetCompMsg<M>
is already registered in the table
(If you call this method twice with the same M
).
sourcefn try_sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError> where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
fn try_sync_comp_sorted<T, M>(
&mut self,
table: &mut SortedMsgTable,
transport: Transport
) -> Result<&mut Self, MsgRegError> where
T: Clone + Into<M> + Component,
M: Clone + Into<T> + Any + Send + Sync + Serialize + DeserializeOwned,
Adds everything needed to sync component T
using message type M
.
Same as sync_comp()
, but doesn’t panic in the event of a MsgRegError
.