pub struct LayerStyle<T>where
T: StyleLayerType,{
pub layout: <T as StyleLayerType>::LayoutProperties,
pub paint: <T as StyleLayerType>::PaintProperties,
pub extra: <T as StyleLayerType>::Extra,
/* private fields */
}Expand description
The style data of a layer of the type T: the members every layer has,
and its type’s properties.
Fields§
§layout: <T as StyleLayerType>::LayoutProperties§paint: <T as StyleLayerType>::PaintProperties§extra: <T as StyleLayerType>::ExtraThe type’s data that isn’t a property, which tile workers don’t get.
Implementations§
Source§impl<T> LayerStyle<T>where
T: StyleLayerType,
impl<T> LayerStyle<T>where
T: StyleLayerType,
Sourcepub fn new(layer_id: String, source_id: String) -> LayerStyle<T>
pub fn new(layer_id: String, source_id: String) -> LayerStyle<T>
A layer named layer_id of the source source_id, with every
property undefined.
Sourcepub fn recover(style: &Arc<dyn ErasedLayerStyle>) -> Option<Arc<LayerStyle<T>>>
pub fn recover(style: &Arc<dyn ErasedLayerStyle>) -> Option<Arc<LayerStyle<T>>>
style as a T layer’s, or None for another type’s. The result
shares style’s allocation.
Sourcepub fn recover_ref(
style: &(dyn ErasedLayerStyle + 'static),
) -> Option<&LayerStyle<T>>
pub fn recover_ref( style: &(dyn ErasedLayerStyle + 'static), ) -> Option<&LayerStyle<T>>
style as a T layer’s, or None for another type’s.
Trait Implementations§
Source§impl<T> Clone for LayerStyle<T>where
T: StyleLayerType,
impl<T> Clone for LayerStyle<T>where
T: StyleLayerType,
Source§fn clone(&self) -> LayerStyle<T>
fn clone(&self) -> LayerStyle<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 for LayerStyle<T>where
T: StyleLayerType,
impl<T> Debug for LayerStyle<T>where
T: StyleLayerType,
Source§impl<T> Deref for LayerStyle<T>where
T: StyleLayerType,
impl<T> Deref for LayerStyle<T>where
T: StyleLayerType,
Source§impl<T> DerefMut for LayerStyle<T>where
T: StyleLayerType,
impl<T> DerefMut for LayerStyle<T>where
T: StyleLayerType,
Source§impl<T> ErasedLayerStyle for LayerStyle<T>where
T: StyleLayerType,
impl<T> ErasedLayerStyle for LayerStyle<T>where
T: StyleLayerType,
fn base(&self) -> &LayerBase
fn info(&self) -> LayerTypeInfo
Source§fn layout_difference(&self, other: &(dyn ErasedLayerStyle + 'static)) -> bool
fn layout_difference(&self, other: &(dyn ErasedLayerStyle + 'static)) -> bool
Whether going from
self to other changes what the layer’s tiles
lay out. True when other is another type’s.Source§fn layout_dependencies(&self) -> Dependency
fn layout_dependencies(&self) -> Dependency
The dependencies of what affects tile layout: the filter and the
layout properties.
Source§fn collect_layout_global_state_refs(&self, refs: &mut VecSet<String>)
fn collect_layout_global_state_refs(&self, refs: &mut VecSet<String>)
Adds the global-state keys read by what affects tile layout, as
layout_dependencies counts it,
to refs.Source§fn collect_layout_host_function_refs(&self, refs: &mut VecSet<String>)
fn collect_layout_host_function_refs(&self, refs: &mut VecSet<String>)
Adds the host-dependent expression function names called by what
affects tile layout, as
layout_dependencies
counts it, to refs.fn populate_font_stack(&self, out: &mut VecSet<Vec<String>>)
fn content_elevation(&self) -> Option<&PropertyValue<f32>>
fn layer_type(&self) -> &'static dyn ErasedStyleLayerType
Source§fn property(&self, name: &str) -> StyleProperty
fn property(&self, name: &str) -> StyleProperty
The property
name (or a paint property’s <name>-transition),
undefined for a name the type lacks.Source§fn serialize_properties(&self, out: &mut VecMap<String, Value>)
fn serialize_properties(&self, out: &mut VecMap<String, Value>)
Writes the defined properties into a layer’s style JSON
out, under
“paint” and “layout”. A key already there stays.Source§fn copy_without_paint(&self, id: &str) -> Arc<dyn ErasedLayerStyle> ⓘ
fn copy_without_paint(&self, id: &str) -> Arc<dyn ErasedLayerStyle> ⓘ
A copy named
id, without the paint properties.Source§fn write(&self, w: &mut Writer<'_>)
fn write(&self, w: &mut Writer<'_>)
Writes the value for its type’s
ErasedStyleLayerType::read_style.Source§impl<T> Wire for LayerStyle<T>where
T: StyleLayerType,
impl<T> Wire for LayerStyle<T>where
T: StyleLayerType,
Auto Trait Implementations§
impl<T> !Freeze for LayerStyle<T>
impl<T> !RefUnwindSafe for LayerStyle<T>
impl<T> !UnwindSafe for LayerStyle<T>
impl<T> Forget for LayerStyle<T>
impl<T> Move for LayerStyle<T>
impl<T> Send for LayerStyle<T>where
Arc<Expr>: Send,
RawVecInner: Send,
OnceLock<Option<Box<[String]>>>: Send,
OnceLock<u64>: Send,
OnceLock<Option<u64>>: Send,
Arc<str>: Send,
Arc<dyn Any + Sync + Send>: Send,
<T as StyleLayerType>::LayoutProperties: Send,
<T as StyleLayerType>::PaintProperties: Send,
<T as StyleLayerType>::Extra: Send,
impl<T> Sync for LayerStyle<T>where
Arc<Expr>: Sync,
RawVecInner: Sync,
OnceLock<Option<Box<[String]>>>: Sync,
OnceLock<u64>: Sync,
OnceLock<Option<u64>>: Sync,
Arc<str>: Sync,
Arc<dyn Any + Sync + Send>: Sync,
<T as StyleLayerType>::LayoutProperties: Sync,
<T as StyleLayerType>::PaintProperties: Sync,
<T as StyleLayerType>::Extra: Sync,
impl<T> Unpin for LayerStyle<T>
impl<T> UnsafeUnpin for LayerStyle<T>where
*const ArcInner<Expr> is !null: UnsafeUnpin,
PhantomData<ArcInner<Expr>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
*const [String] is !null: UnsafeUnpin,
PhantomData<[String]>: UnsafeUnpin,
PhantomData<Option<Box<[String]>>>: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
PhantomData<Option<u64>>: UnsafeUnpin,
PhantomData<Entry>: UnsafeUnpin,
<T as StyleLayerType>::LayoutProperties: UnsafeUnpin,
<T as StyleLayerType>::PaintProperties: UnsafeUnpin,
<T as StyleLayerType>::Extra: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.