pub struct Integer {
value: CSSInteger,
was_calc: bool,
}
Expand description
A specified <integer>
, optionally coming from a calc()
expression.
Fields§
§value: CSSInteger
§was_calc: bool
Implementations§
source§impl Integer
impl Integer
sourcepub fn new(val: CSSInteger) -> Self
pub fn new(val: CSSInteger) -> Self
Trivially constructs a new Integer
value.
sourcepub fn value(&self) -> CSSInteger
pub fn value(&self) -> CSSInteger
Returns the integer value associated with this value.
sourcefn from_calc(val: CSSInteger) -> Self
fn from_calc(val: CSSInteger) -> Self
Trivially constructs a new integer value from a calc()
expression.
source§impl Integer
impl Integer
sourcepub fn parse_with_minimum<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
min: i32,
) -> Result<Integer, ParseError<'i>>
pub fn parse_with_minimum<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, min: i32, ) -> Result<Integer, ParseError<'i>>
Parse an integer value which is at least min
.
sourcepub fn parse_non_negative<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Integer, ParseError<'i>>
pub fn parse_non_negative<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Integer, ParseError<'i>>
Parse a non-negative integer.
sourcepub fn parse_positive<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Integer, ParseError<'i>>
pub fn parse_positive<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Integer, ParseError<'i>>
Parse a positive integer (>= 1).
Trait Implementations§
source§impl MallocSizeOf for Integer
impl MallocSizeOf for Integer
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 Parse for Integer
impl Parse for Integer
source§fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parse a value of this type. Read more
source§impl PartialEq for Integer
impl PartialEq for Integer
source§impl PartialOrd for Integer
impl PartialOrd for Integer
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl SpecifiedValueInfo for Integer
impl SpecifiedValueInfo for Integer
source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
Supported CssTypes by the given value type. Read more
source§impl ToComputedValue for Integer
impl ToComputedValue for Integer
§type ComputedValue = i32
type ComputedValue = i32
The computed value type we’re going to be converted to.
source§fn to_computed_value(&self, _: &Context<'_>) -> i32
fn to_computed_value(&self, _: &Context<'_>) -> i32
Convert a specified value to a computed value, using itself and the data
inside the
Context
.source§fn from_computed_value(computed: &i32) -> Self
fn from_computed_value(computed: &i32) -> Self
Convert a computed value to specified value form. Read more
impl Copy for Integer
impl Eq for Integer
impl StructuralPartialEq for Integer
Auto Trait Implementations§
impl Freeze for Integer
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnwindSafe for Integer
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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