pub struct Source { /* private fields */ }Expand description
A source of a style version: its id, which instance it is, the members
every source has, and its type’s data. A clone shares the data; two
sources are the same when Source::ptr_eq says so.
Implementations§
Source§impl Source
impl Source
Sourcepub fn new<T: StyleSourceType>(id: &str, data: SourceData<T>) -> Self
pub fn new<T: StyleSourceType>(id: &str, data: SourceData<T>) -> Self
A new source id of data, with the default common members.
Sourcepub fn from_erased(id: &str, data: Arc<dyn ErasedSource>) -> Self
pub fn from_erased(id: &str, data: Arc<dyn ErasedSource>) -> Self
A new source id of erased data, with the default common members.
Sourcepub fn with_data<T: StyleSourceType>(&self, data: SourceData<T>) -> Self
pub fn with_data<T: StyleSourceType>(&self, data: SourceData<T>) -> Self
This source with data in place of its data.
Sourcepub fn with_description(&self, description: Option<ErasedDescription>) -> Self
pub fn with_description(&self, description: Option<ErasedDescription>) -> Self
This source with description as its description.
Sourcepub fn with_common(&self, common: SourceCommon) -> Self
pub fn with_common(&self, common: SourceCommon) -> Self
This source with common in place of its common members. Logs a
warning when its overscale factor caps its prefetch delta.
pub fn id(&self) -> &str
pub fn instance(&self) -> SourceInstance
pub fn info(&self) -> SourceTypeInfo
pub fn source_type(&self) -> &'static dyn ErasedStyleSourceType
pub fn common(&self) -> &SourceCommon
Sourcepub fn data(&self) -> &dyn ErasedSource
pub fn data(&self) -> &dyn ErasedSource
The source’s type’s data.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Source
impl !UnwindSafe for Source
impl Forget for Source
impl Freeze for Sourcewhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
NonZero<u64>: Freeze,
*const ArcInner<dyn ErasedSource> is !null: Freeze,
PhantomData<ArcInner<dyn ErasedSource>>: Freeze,
impl Move for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Sourcewhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
*const ArcInner<dyn ErasedSource> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ErasedSource>>: 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