Enum pgdo::runtime::constraint::Constraint
source · pub enum Constraint {
BinDir(GlobMatcher),
Version(PartialVersion),
Either(Box<Constraint>, Box<Constraint>),
Both(Box<Constraint>, Box<Constraint>),
Not(Box<Constraint>),
Anything,
Nothing,
}
Expand description
A constraint used when selecting a PostgreSQL runtime.
Variants§
BinDir(GlobMatcher)
Match the runtime’s bindir
.
Version(PartialVersion)
Match the given version.
Either(Box<Constraint>, Box<Constraint>)
Either constraint can be satisfied.
Both(Box<Constraint>, Box<Constraint>)
Both constraints must be satisfied.
Not(Box<Constraint>)
Invert the given constraint; use !constraint
for the same effect.
Anything
Match any runtime.
Nothing
Match no runtimes at all.
Implementations§
source§impl Constraint
impl Constraint
sourcepub fn version(version: &str) -> Result<Self, VersionError>
pub fn version(version: &str) -> Result<Self, VersionError>
Match the given runtime against this version.
sourcepub fn any<C: IntoIterator<Item = Constraint>>(constraints: C) -> Self
pub fn any<C: IntoIterator<Item = Constraint>>(constraints: C) -> Self
Match any of the given constraints.
If there are no constraints, this returns Self::Nothing
.
sourcepub fn all<C: IntoIterator<Item = Constraint>>(constraints: C) -> Self
pub fn all<C: IntoIterator<Item = Constraint>>(constraints: C) -> Self
Match all of the given constraints.
If there are no constraints, this returns Self::Anything
.
Trait Implementations§
source§impl BitAnd for Constraint
impl BitAnd for Constraint
source§impl BitOr for Constraint
impl BitOr for Constraint
source§impl Clone for Constraint
impl Clone for Constraint
source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
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 Constraint
impl Debug for Constraint
source§impl From<PartialVersion> for Constraint
impl From<PartialVersion> for Constraint
source§fn from(version: PartialVersion) -> Self
fn from(version: PartialVersion) -> Self
Convert a PartialVersion
into a Constraint::Version
.
source§impl FromStr for Constraint
impl FromStr for Constraint
Auto Trait Implementations§
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
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