pub struct PkgConfig { /* private fields */ }
Expand description
A parsed pkg-config pc file
Implementations§
source§impl PkgConfig
impl PkgConfig
sourcepub fn open(path: &Path) -> Result<Self, OpenError>
pub fn open(path: &Path) -> Result<Self, OpenError>
Open and parse a pkg-config
.pc
file. This defines the pcfiledir
variable as the given path.
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError>
Read a pkg-config
.pc
file from a byte slice
sourcepub fn libs(&self) -> Result<Links, VariableError>
pub fn libs(&self) -> Result<Links, VariableError>
Get an iterator over the items in the Libs
key
sourcepub fn libs_private(&self) -> Result<Links, VariableError>
pub fn libs_private(&self) -> Result<Links, VariableError>
Get an iterator over the items in the Libs.private
key
sourcepub fn set_variable(
&mut self,
var: impl AsRef<[u8]>,
value: impl AsRef<[u8]>,
allow_overwrite: bool,
) -> bool
pub fn set_variable( &mut self, var: impl AsRef<[u8]>, value: impl AsRef<[u8]>, allow_overwrite: bool, ) -> bool
Set a variable
sourcepub fn set_variable_escaped(
&mut self,
var: impl AsRef<[u8]>,
value: impl AsRef<[u8]>,
allow_overwrite: bool,
) -> bool
pub fn set_variable_escaped( &mut self, var: impl AsRef<[u8]>, value: impl AsRef<[u8]>, allow_overwrite: bool, ) -> bool
Set a variable and escape it
sourcepub fn expand_variable(
&self,
var: impl AsRef<[u8]>,
) -> Result<Vec<u8>, VariableError>
pub fn expand_variable( &self, var: impl AsRef<[u8]>, ) -> Result<Vec<u8>, VariableError>
Get a variable and expand all variables it references
sourcepub fn expand_variables_in(
&self,
input: impl AsRef<[u8]>,
) -> Result<Vec<u8>, VariableError>
pub fn expand_variables_in( &self, input: impl AsRef<[u8]>, ) -> Result<Vec<u8>, VariableError>
Expand all variables in the input
sourcepub fn key_bytes_expanded(
&self,
key: impl AsRef<[u8]>,
) -> Result<Option<Vec<u8>>, VariableError>
pub fn key_bytes_expanded( &self, key: impl AsRef<[u8]>, ) -> Result<Option<Vec<u8>>, VariableError>
Get the raw bytes of a key with variables expanded
sourcepub fn key_bytes_expanded_unescaped_split(
&self,
key: impl AsRef<[u8]>,
) -> Result<Option<UnescapeAndSplit>, VariableError>
pub fn key_bytes_expanded_unescaped_split( &self, key: impl AsRef<[u8]>, ) -> Result<Option<UnescapeAndSplit>, VariableError>
Get the raw bytes of a key with variables expanded, unescaped and split by spaces
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PkgConfig
impl RefUnwindSafe for PkgConfig
impl Send for PkgConfig
impl Sync for PkgConfig
impl Unpin for PkgConfig
impl UnwindSafe for PkgConfig
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)