MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / try_from

Method try_from

src/sql/src/plan.rs:1801–1808  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

1799impl TryFrom<&str> for NetworkPolicyRuleAction {
1800 type Error = PlanError;
1801 fn try_from(value: &str) -> Result<Self, Self::Error> {
1802 match value.to_uppercase().as_str() {
1803 "ALLOW" => Ok(Self::Allow),
1804 _ => Err(PlanError::Unstructured(
1805 "Allow is the only valid option".into(),
1806 )),
1807 }
1808 }
1809}
1810
1811#[derive(Debug, Clone, Serialize, PartialEq, Eq, Ord, PartialOrd, Hash)]

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected