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>

§

type Marker = IsSendFalse

Type of marker that may prevent the automatic std::marker::Send implementation.
source§

const MARKER_INSTANCE: Self::Marker = _

Instance of the associated Self::Marker.
source§

const VALUE: bool = false

Yes/no flag.
source§

impl ValidIsSend for IsSend<true>

§

type Marker = IsSendTrue

Type of marker that may prevent the automatic std::marker::Send implementation.
source§

const MARKER_INSTANCE: Self::Marker = IsSendTrue

Instance of the associated Self::Marker.
source§

const VALUE: bool = true

Yes/no flag.

Auto Trait Implementations§

§

impl<const F: bool> RefUnwindSafe for IsSend<F>

§

impl<const F: bool> Send for IsSend<F>

§

impl<const F: bool> Sync for IsSend<F>

§

impl<const F: bool> Unpin for IsSend<F>

§

impl<const F: bool> UnwindSafe for IsSend<F>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for Twhere W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.