pub struct ShapeProject {
pub project: ProjectSection,
pub modules: ModulesSection,
pub dependencies: HashMap<String, DependencySpec>,
pub dev_dependencies: HashMap<String, DependencySpec>,
pub build: BuildSection,
pub permissions: Option<PermissionsSection>,
pub sandbox: Option<SandboxSection>,
pub extensions: Vec<ExtensionEntry>,
pub extension_sections: HashMap<String, Value>,
}Expand description
Top-level shape.toml configuration
Fields§
§project: ProjectSection§modules: ModulesSection§dependencies: HashMap<String, DependencySpec>§dev_dependencies: HashMap<String, DependencySpec>§build: BuildSection§permissions: Option<PermissionsSection>§sandbox: Option<SandboxSection>§extensions: Vec<ExtensionEntry>§extension_sections: HashMap<String, Value>Implementations§
Source§impl ShapeProject
impl ShapeProject
Sourcepub fn validate(&self) -> Vec<String>
pub fn validate(&self) -> Vec<String>
Validate the project configuration and return a list of errors.
Sourcepub fn effective_permission_set(&self) -> PermissionSet
pub fn effective_permission_set(&self) -> PermissionSet
Compute the effective PermissionSet for this project.
- If
[permissions]is absent, returnsPermissionSet::full()(backwards compatible). - If present, converts the section to a
PermissionSet.
Sourcepub fn extension_section_as_json(&self, name: &str) -> Option<Value>
pub fn extension_section_as_json(&self, name: &str) -> Option<Value>
Get an extension section as JSON value.
Sourcepub fn native_dependencies(
&self,
) -> Result<HashMap<String, NativeDependencySpec>, String>
pub fn native_dependencies( &self, ) -> Result<HashMap<String, NativeDependencySpec>, String>
Parse typed native dependency specs from [native-dependencies].
Sourcepub fn extension_section_names(&self) -> Vec<&str>
pub fn extension_section_names(&self) -> Vec<&str>
Get all extension section names.
Trait Implementations§
Source§impl Clone for ShapeProject
impl Clone for ShapeProject
Source§fn clone(&self) -> ShapeProject
fn clone(&self) -> ShapeProject
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 ShapeProject
impl Debug for ShapeProject
Source§impl Default for ShapeProject
impl Default for ShapeProject
Source§fn default() -> ShapeProject
fn default() -> ShapeProject
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ShapeProject
impl<'de> Deserialize<'de> for ShapeProject
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 ShapeProject
impl RefUnwindSafe for ShapeProject
impl Send for ShapeProject
impl Sync for ShapeProject
impl Unpin for ShapeProject
impl UnsafeUnpin for ShapeProject
impl UnwindSafe for ShapeProject
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,
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