pub struct SourceData<T: StyleSourceType> {
pub options: T::Options,
pub description: Option<ErasedDescription>,
pub load: u64,
}Expand description
The data of a source of the type T: its options and what loading them
found.
Fields§
§options: T::Options§description: Option<ErasedDescription>None until the source’s description loads.
load: u64Grows with each change to the options or the data that starts a new load, and tags that load.
Implementations§
Source§impl<T: StyleSourceType> SourceData<T>
impl<T: StyleSourceType> SourceData<T>
Sourcepub fn with_description(
options: T::Options,
description: ErasedDescription,
) -> Self
pub fn with_description( options: T::Options, description: ErasedDescription, ) -> Self
A source of options with description.
Sourcepub fn recover(source: &Source) -> Option<&Self>
pub fn recover(source: &Source) -> Option<&Self>
source’s data as a T source’s, or None for another type’s.
Sourcepub fn description<D: Any>(&self) -> Option<&D>
pub fn description<D: Any>(&self) -> Option<&D>
The source’s description as a D, or None until it loads or if
it’s another type.
Trait Implementations§
Source§impl<T: StyleSourceType> Clone for SourceData<T>
impl<T: StyleSourceType> Clone for SourceData<T>
Source§impl<T: StyleSourceType> ErasedSource for SourceData<T>
impl<T: StyleSourceType> ErasedSource for SourceData<T>
fn source_type(&self) -> &'static dyn ErasedStyleSourceType
Source§fn description(&self) -> Option<&ErasedDescription>
fn description(&self) -> Option<&ErasedDescription>
Source§fn with_description(
&self,
description: Option<ErasedDescription>,
) -> Arc<dyn ErasedSource> ⓘ
fn with_description( &self, description: Option<ErasedDescription>, ) -> Arc<dyn ErasedSource> ⓘ
This data with
description in place of its description.Auto Trait Implementations§
impl<T> !RefUnwindSafe for SourceData<T>
impl<T> !UnwindSafe for SourceData<T>
impl<T> Forget for SourceData<T>
impl<T> Freeze for SourceData<T>
impl<T> Move for SourceData<T>
impl<T> Send for SourceData<T>
impl<T> Sync for SourceData<T>
impl<T> Unpin for SourceData<T>
impl<T> UnsafeUnpin for SourceData<T>where
<T as StyleSourceType>::Options: UnsafeUnpin,
*const ArcInner<dyn Any + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Any + Sync + Send>>: UnsafeUnpin,
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more