pub struct GraphPolicyDocument {
pub graph_policy: GraphPolicy,
}Expand description
A parsed graph-policy document: the typed graph plus its authored rules.
Fields§
§graph_policy: GraphPolicyThe graph_policy block (graph + rules).
Implementations§
Source§impl GraphPolicyDocument
impl GraphPolicyDocument
Sourcepub fn from_yaml(yaml: &str) -> Result<Self, String>
pub fn from_yaml(yaml: &str) -> Result<Self, String>
Parse a document from YAML, building and type-checking the graph.
Sourcepub fn from_json_value(value: JsonValue) -> Result<Self, String>
pub fn from_json_value(value: JsonValue) -> Result<Self, String>
Build a document from an already-parsed JSON value.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate the graph and rules: graph integrity, the company-schema cross-check, at least one rule, and well-formed resource globs.
Sourcepub fn graph_schema(&self) -> GraphSchema
pub fn graph_schema(&self) -> GraphSchema
The declarative company GraphSchema this document is validated against.
Trait Implementations§
Source§impl Clone for GraphPolicyDocument
impl Clone for GraphPolicyDocument
Source§fn clone(&self) -> GraphPolicyDocument
fn clone(&self) -> GraphPolicyDocument
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 Debug for GraphPolicyDocument
impl Debug for GraphPolicyDocument
Source§impl<'de> Deserialize<'de> for GraphPolicyDocument
impl<'de> Deserialize<'de> for GraphPolicyDocument
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 GraphPolicyDocument
impl RefUnwindSafe for GraphPolicyDocument
impl Send for GraphPolicyDocument
impl Sync for GraphPolicyDocument
impl Unpin for GraphPolicyDocument
impl UnsafeUnpin for GraphPolicyDocument
impl UnwindSafe for GraphPolicyDocument
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