pub(super) struct RuleHead {
pub(super) kind: String,
parameters: Option<Value>,
}Fields§
§kind: String§parameters: Option<Value>Implementations§
Source§impl RuleHead
impl RuleHead
Sourcepub(super) const fn decoder<'a>(&'a self, ruleset: &'a str) -> HeadDecoder<'a>
pub(super) const fn decoder<'a>(&'a self, ruleset: &'a str) -> HeadDecoder<'a>
A decoder for the parameters of this rule.
pub(super) fn decode(ruleset: &str, rule: &Value) -> Result<Self, ForgeError>
Sourcepub(super) fn has_entries(&self, key: &str) -> bool
pub(super) fn has_entries(&self, key: &str) -> bool
Whether the parameter key is a list with at least one entry.
Sourcepub(super) fn parameters<T: for<'a> Facet<'a>>(
&self,
ruleset: &str,
) -> Result<T, ForgeError>
pub(super) fn parameters<T: for<'a> Facet<'a>>( &self, ruleset: &str, ) -> Result<T, ForgeError>
Decode the rule’s parameters, which a rule without any decodes as empty.
Keys that T does not declare and keys that are null are dropped
first, so GitHub can add parameters. Declared keys it omits are then
filled with GitHub’s defaults.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleHead
impl RefUnwindSafe for RuleHead
impl Send for RuleHead
impl Sync for RuleHead
impl Unpin for RuleHead
impl UnsafeUnpin for RuleHead
impl UnwindSafe for RuleHead
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