MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / validate

Method validate

src/pglite/pg_dump.rs:78–93  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

76 }
77
78 pub(crate) fn validate(&self) -> Result<()> {
79 for (name, value) in [("database", &self.database), ("username", &self.username)] {
80 anyhow::ensure!(
81 !value.is_empty() && !value.contains('\0'),
82 "pg_dump {name} must not be empty or contain NUL bytes"
83 );
84 }
85 for arg in &self.args {
86 anyhow::ensure!(
87 !arg.contains('\0'),
88 "pg_dump argument must not contain NUL bytes"
89 );
90 validate_passthrough_arg(arg)?;
91 }
92 Ok(())
93 }
94
95 pub(crate) fn database_ref(&self) -> &str {
96 &self.database

Calls 1

validate_passthrough_argFunction · 0.85