pub struct ControlFile {
pub comment: String,
pub default_version: String,
pub module_pathname: Option<String>,
pub relocatable: bool,
pub superuser: bool,
pub schema: Option<String>,
pub trusted: bool,
}
Expand description
The parsed contents of a .control
file.
use pgrx_sql_entity_graph::ControlFile;
use std::convert::TryFrom;
let context = include_str!("../../pgrx-examples/arrays/arrays.control");
let _control_file = ControlFile::try_from(context)?;
Fields§
§comment: String
§default_version: String
§module_pathname: Option<String>
§relocatable: bool
§superuser: bool
§schema: Option<String>
§trusted: bool
Implementations§
Source§impl ControlFile
impl ControlFile
Sourcepub fn from_str(input: &str) -> Result<Self, ControlFileError>
pub fn from_str(input: &str) -> Result<Self, ControlFileError>
Parse a .control
file, performing all known pgrx dynamic variable substitutions.
§Supported Dynamic Variable Substitutions
@CARGO_VERSION@
: Replaced with the value of the environment variable CARGO_PKG_VERSION
,
which is set by cargo, or failing that, cargo-pgrx
using the package
version from the extension’s Cargo.toml
file
§Errors
Returns a ControlFileError
if any of the required fields are missing from the input string
or if any required environment variables (for dynamic variable substitution) are missing
use pgrx_sql_entity_graph::ControlFile;
let context = include_str!("../../pgrx-examples/arrays/arrays.control");
let _control_file = ControlFile::from_str(context)?;
Trait Implementations§
Source§impl Clone for ControlFile
impl Clone for ControlFile
Source§fn clone(&self) -> ControlFile
fn clone(&self) -> ControlFile
Returns a copy of the value. Read more
1.0.0 · 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 ControlFile
impl Debug for ControlFile
Source§impl From<ControlFile> for SqlGraphEntity
impl From<ControlFile> for SqlGraphEntity
Source§fn from(val: ControlFile) -> Self
fn from(val: ControlFile) -> Self
Converts to this type from the input type.
Source§impl Hash for ControlFile
impl Hash for ControlFile
Source§impl Ord for ControlFile
impl Ord for ControlFile
Source§fn cmp(&self, other: &ControlFile) -> Ordering
fn cmp(&self, other: &ControlFile) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ControlFile
impl PartialEq for ControlFile
Source§impl PartialOrd for ControlFile
impl PartialOrd for ControlFile
Source§impl SqlGraphIdentifier for ControlFile
impl SqlGraphIdentifier for ControlFile
Source§impl ToSql for ControlFile
impl ToSql for ControlFile
Source§impl TryFrom<&str> for ControlFile
impl TryFrom<&str> for ControlFile
Source§impl TryFrom<PathBuf> for ControlFile
impl TryFrom<PathBuf> for ControlFile
impl Eq for ControlFile
impl StructuralPartialEq for ControlFile
Auto Trait Implementations§
impl Freeze for ControlFile
impl RefUnwindSafe for ControlFile
impl Send for ControlFile
impl Sync for ControlFile
impl Unpin for ControlFile
impl UnwindSafe for ControlFile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.