pub struct StyleSpecDocument {
pub version: u8,
pub name: Option<String>,
pub sources: HashMap<StyleSourceId, StyleSpecSource>,
pub layers: Vec<StyleSpecLayer>,
pub terrain: Option<StyleSpecTerrain>,
pub projection: Option<StyleSpecProjection>,
}Expand description
Declarative JSON style document.
Fields§
§version: u8Style-spec version.
name: Option<String>Optional human-readable style name.
sources: HashMap<StyleSourceId, StyleSpecSource>Declared source definitions.
layers: Vec<StyleSpecLayer>Ordered layer definitions.
terrain: Option<StyleSpecTerrain>Optional terrain configuration.
projection: Option<StyleSpecProjection>Optional top-level projection configuration.
Implementations§
Source§impl StyleSpecDocument
impl StyleSpecDocument
Sourcepub fn from_json(json: &str) -> Result<Self, StyleSpecError>
pub fn from_json(json: &str) -> Result<Self, StyleSpecError>
Parse a JSON style string.
Sourcepub fn resolve(
&self,
registry: &StyleSourceRegistry,
) -> Result<StyleDocument, StyleSpecError>
pub fn resolve( &self, registry: &StyleSourceRegistry, ) -> Result<StyleDocument, StyleSpecError>
Resolve the declarative style into a runtime StyleDocument.
Trait Implementations§
Source§impl Clone for StyleSpecDocument
impl Clone for StyleSpecDocument
Source§fn clone(&self) -> StyleSpecDocument
fn clone(&self) -> StyleSpecDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StyleSpecDocument
impl Debug for StyleSpecDocument
Source§impl<'de> Deserialize<'de> for StyleSpecDocument
impl<'de> Deserialize<'de> for StyleSpecDocument
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StyleSpecDocument
impl RefUnwindSafe for StyleSpecDocument
impl Send for StyleSpecDocument
impl Sync for StyleSpecDocument
impl Unpin for StyleSpecDocument
impl UnsafeUnpin for StyleSpecDocument
impl UnwindSafe for StyleSpecDocument
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