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

Method opt_parse

src/testdrive/src/parser.rs:819–833  ·  view source on GitHub ↗
(&mut self, name: &str)

Source from the content-addressed store, hash-verified

817 }
818
819 pub fn opt_parse<T>(&mut self, name: &str) -> Result<Option<T>, anyhow::Error>
820 where
821 T: FromStr,
822 T::Err: Error + Send + Sync + 'static,
823 {
824 match self.opt_string(name) {
825 Some(val) => {
826 let t = val
827 .parse()
828 .with_context(|| format!("parsing {} parameter", name))?;
829 Ok(Some(t))
830 }
831 None => Ok(None),
832 }
833 }
834
835 pub fn parse<T>(&mut self, name: &str) -> Result<T, anyhow::Error>
836 where

Callers 9

parseMethod · 0.80
build_contentsFunction · 0.80
run_verify_keysFunction · 0.80
run_uploadFunction · 0.80
run_add_partitionsFunction · 0.80
run_ingestFunction · 0.80
run_verify_dataFunction · 0.80
run_create_topicFunction · 0.80
run_verify_topicFunction · 0.80

Calls 3

opt_stringMethod · 0.80
with_contextMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected