Struct dungeon_cell::IsSend
source · pub struct IsSend<const F: bool> { /* private fields */ }
Expand description
Flag for if a type implements std::marker::Send
.
This is the type to use where ValidIsSend
is required.
By storing the associated Marker
, a type
will be forced to not auto implement std::marker::Send
when IsSend<false>
is used. However, the use of IsSend<true>
does not force the type to actually implement
std::marker::Send
. It just allows it to. This is used by dungeon_cell
types to
implement std::marker::Send
safely based on what the user needs.
Examples
use static_assertions::*;
use dungeon_cell::{IsSend, valid_generic_markers::ValidIsSend};
struct Test<S: ValidIsSend> {
_marker: S::Marker,
}
assert_not_impl_all!(Test<IsSend<false>>: Send);
assert_impl_all!(Test<IsSend<true>>: Send);
Trait Implementations§
source§impl ValidIsSend for IsSend<false>
impl ValidIsSend for IsSend<false>
§type Marker = IsSendFalse
type Marker = IsSendFalse
Type of marker that may prevent the automatic
std::marker::Send
implementation.source§const MARKER_INSTANCE: Self::Marker = _
const MARKER_INSTANCE: Self::Marker = _
Instance of the associated
Self::Marker
.source§impl ValidIsSend for IsSend<true>
impl ValidIsSend for IsSend<true>
§type Marker = IsSendTrue
type Marker = IsSendTrue
Type of marker that may prevent the automatic
std::marker::Send
implementation.source§const MARKER_INSTANCE: Self::Marker = IsSendTrue
const MARKER_INSTANCE: Self::Marker = IsSendTrue
Instance of the associated
Self::Marker
.