#[repr(C)]pub struct GenericLightDark<T> {
pub light: T,
pub dark: T,
}
Expand description
A light-dark(
Fields§
§light: T
The value returned when using a light theme.
dark: T
The value returned when using a dark theme.
Implementations§
Source§impl<T> GenericLightDark<T>
impl<T> GenericLightDark<T>
Sourcepub fn parse_args_with<'i>(
input: &mut Parser<'i, '_>,
parse_one: impl FnMut(&mut Parser<'i, '_>) -> Result<T, ParseError<'i>>,
) -> Result<Self, ParseError<'i>>
pub fn parse_args_with<'i>( input: &mut Parser<'i, '_>, parse_one: impl FnMut(&mut Parser<'i, '_>) -> Result<T, ParseError<'i>>, ) -> Result<Self, ParseError<'i>>
Parse the arguments of the light-dark() function.
Sourcepub fn parse_with<'i>(
input: &mut Parser<'i, '_>,
parse_one: impl FnMut(&mut Parser<'i, '_>) -> Result<T, ParseError<'i>>,
) -> Result<Self, ParseError<'i>>
pub fn parse_with<'i>( input: &mut Parser<'i, '_>, parse_one: impl FnMut(&mut Parser<'i, '_>) -> Result<T, ParseError<'i>>, ) -> Result<Self, ParseError<'i>>
Parse the light-dark() function.
Source§impl<T: ToComputedValue> GenericLightDark<T>
impl<T: ToComputedValue> GenericLightDark<T>
Sourcepub fn compute(&self, cx: &Context<'_>) -> T::ComputedValue
pub fn compute(&self, cx: &Context<'_>) -> T::ComputedValue
Choose the light or dark version of this value for computation purposes, and compute it.
Trait Implementations§
Source§impl<T: Clone> Clone for GenericLightDark<T>
impl<T: Clone> Clone for GenericLightDark<T>
Source§fn clone(&self) -> GenericLightDark<T>
fn clone(&self) -> GenericLightDark<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for GenericLightDark<T>
impl<T: Debug> Debug for GenericLightDark<T>
Source§impl<T> MallocSizeOf for GenericLightDark<T>where
T: MallocSizeOf,
impl<T> MallocSizeOf for GenericLightDark<T>where
T: MallocSizeOf,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl<T: PartialEq> PartialEq for GenericLightDark<T>
impl<T: PartialEq> PartialEq for GenericLightDark<T>
Source§impl<T> SpecifiedValueInfo for GenericLightDark<T>
impl<T> SpecifiedValueInfo for GenericLightDark<T>
Source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
Supported CssTypes by the given value type. Read more
Source§impl<T> ToCss for GenericLightDark<T>where
T: ToCss,
impl<T> ToCss for GenericLightDark<T>where
T: ToCss,
Source§impl<T> ToResolvedValue for GenericLightDark<T>where
T: ToResolvedValue,
impl<T> ToResolvedValue for GenericLightDark<T>where
T: ToResolvedValue,
Source§type ResolvedValue = GenericLightDark<<T as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericLightDark<<T as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.
Source§impl<T> ToShmem for GenericLightDark<T>where
T: ToShmem,
impl<T> ToShmem for GenericLightDark<T>where
T: ToShmem,
impl<T> StructuralPartialEq for GenericLightDark<T>
Auto Trait Implementations§
impl<T> Freeze for GenericLightDark<T>where
T: Freeze,
impl<T> RefUnwindSafe for GenericLightDark<T>where
T: RefUnwindSafe,
impl<T> Send for GenericLightDark<T>where
T: Send,
impl<T> Sync for GenericLightDark<T>where
T: Sync,
impl<T> Unpin for GenericLightDark<T>where
T: Unpin,
impl<T> UnwindSafe for GenericLightDark<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert