use core ::marker ::PhantomData;
use crate :: *;
#[ derive( Debug, Default, Clone, Copy ) ]
pub struct AttributePropertySingletoneMarker;
#[ derive( Debug, Default, Clone, Copy ) ]
pub struct AttributePropertySingletone< Marker = AttributePropertySingletoneMarker >(bool, ::core ::marker ::PhantomData< Marker >);
impl< Marker > AttributePropertySingletone< Marker >
{
#[ must_use ]
#[ inline( always ) ]
pub fn internal(self) -> bool
{
self.0
}
#[ must_use ]
#[ inline( always ) ]
pub fn ref_internal( &self ) -> &bool
{
&self.0
}
}
impl< Marker, IntoT > Assign< AttributePropertySingletone<Marker >, IntoT> for AttributePropertySingletone< Marker >
where
IntoT: Into< AttributePropertySingletone<Marker >>,
{
#[ inline( always ) ]
fn assign(&mut self, component: IntoT)
{
*self = component.into();
}
}
impl< Marker > AttributePropertyComponent for AttributePropertySingletone< Marker >
where
Marker: AttributePropertyComponent,
{
const KEYWORD: &'static str = Marker ::KEYWORD;
}
impl< Marker > From< bool > for AttributePropertySingletone< Marker >
{
#[ inline( always ) ]
#[ allow( clippy ::default_constructed_unit_structs ) ]
fn from(src: bool) -> Self
{
Self(src, PhantomData ::default())
}
}
impl< Marker > From< AttributePropertySingletone<Marker >> for bool
{
#[ inline( always ) ]
fn from(src: AttributePropertySingletone< Marker >) -> Self
{
src.0
}
}
impl< Marker > core ::ops ::Deref for AttributePropertySingletone< Marker >
{
type Target = bool;
#[ inline( always ) ]
fn deref( &self ) -> &bool
{
&self.0
}
}
impl< Marker > AsRef< bool > for AttributePropertySingletone< Marker >
{
#[ inline( always ) ]
fn as_ref( &self ) -> &bool
{
&self.0
}
}