Struct style::stylesheets::origin::PerOrigin
source · pub struct PerOrigin<T> {
pub user_agent: T,
pub user: T,
pub author: T,
}
Expand description
An object that stores a T
for each origin of the CSS cascade.
Fields§
§user_agent: T
Data for Origin::UserAgent
.
user: T
Data for Origin::User
.
Data for Origin::Author
.
Implementations§
source§impl<T> PerOrigin<T>
impl<T> PerOrigin<T>
sourcepub fn borrow_for_origin(&self, origin: &Origin) -> &T
pub fn borrow_for_origin(&self, origin: &Origin) -> &T
Returns a reference to the per-origin data for the specified origin.
sourcepub fn borrow_mut_for_origin(&mut self, origin: &Origin) -> &mut T
pub fn borrow_mut_for_origin(&mut self, origin: &Origin) -> &mut T
Returns a mutable reference to the per-origin data for the specified origin.
sourcepub fn iter_origins(&self) -> PerOriginIter<'_, T> ⓘ
pub fn iter_origins(&self) -> PerOriginIter<'_, T> ⓘ
Iterates over references to per-origin extra style data, from highest level (author) to lowest (user agent).
sourcepub fn iter_origins_rev(&self) -> PerOriginIter<'_, T> ⓘ
pub fn iter_origins_rev(&self) -> PerOriginIter<'_, T> ⓘ
Iterates over references to per-origin extra style data, from lowest level (user agent) to highest (author).
sourcepub fn iter_mut_origins(&mut self) -> PerOriginIterMut<'_, T> ⓘ
pub fn iter_mut_origins(&mut self) -> PerOriginIterMut<'_, T> ⓘ
Iterates over mutable references to per-origin extra style data, from highest level (author) to lowest (user agent).
Trait Implementations§
source§impl<T> MallocSizeOf for PerOrigin<T>where
T: MallocSizeOf,
impl<T> MallocSizeOf for PerOrigin<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.
Auto Trait Implementations§
impl<T> Freeze for PerOrigin<T>where
T: Freeze,
impl<T> RefUnwindSafe for PerOrigin<T>where
T: RefUnwindSafe,
impl<T> Send for PerOrigin<T>where
T: Send,
impl<T> Sync for PerOrigin<T>where
T: Sync,
impl<T> Unpin for PerOrigin<T>where
T: Unpin,
impl<T> UnwindSafe for PerOrigin<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> 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