Struct rb_sys_build::RbConfig
source · [−]pub struct RbConfig {
pub search_paths: Vec<SearchPath>,
pub libs: Vec<Library>,
pub link_args: Vec<String>,
pub cflags: Vec<String>,
pub blocklist_lib: Vec<String>,
/* private fields */
}Expand description
Extracts structured information from raw compiler/linker flags to make compiling Ruby gems easier.
Fields
search_paths: Vec<SearchPath>libs: Vec<Library>link_args: Vec<String>cflags: Vec<String>blocklist_lib: Vec<String>Implementations
sourceimpl RbConfig
impl RbConfig
sourcepub fn new() -> RbConfig
pub fn new() -> RbConfig
Creates a new, blank RbConfig. You likely want to use RbConfig::current() instead.
sourcepub fn libruby_static_name(&self) -> String
pub fn libruby_static_name(&self) -> String
Get the name for libruby-static (i.e. ruby.3.1-static).
sourcepub fn libruby_so_name(&self) -> String
pub fn libruby_so_name(&self) -> String
Get the name for libruby (i.e. ruby.3.1)
sourcepub fn blocklist_lib(&mut self, name: &str) -> &mut RbConfig
pub fn blocklist_lib(&mut self, name: &str) -> &mut RbConfig
Filter the libs, removing the ones that are not needed.
sourcepub fn ruby_version(&self) -> String
pub fn ruby_version(&self) -> String
Returns the current ruby version.
sourcepub fn get(&self, key: &str) -> String
pub fn get(&self, key: &str) -> String
Returns the value of the given key from the either the matching
RBCONFIG_{key} environment variable or RbConfig::CONFIG[{key}] hash.
sourcepub fn get_optional(&self, key: &str) -> Option<String>
pub fn get_optional(&self, key: &str) -> Option<String>
Returns the value of the given key from the either the matching
RBCONFIG_{key} environment variable or RbConfig::CONFIG[{key}] hash.
sourcepub fn push_cflags(&mut self, cflags: &str) -> &mut Self
pub fn push_cflags(&mut self, cflags: &str) -> &mut Self
Push cflags string
pub fn major_minor(&self) -> (u32, u32)
sourcepub fn cargo_args(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn cargo_args(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get the rb_config output for cargo
sourcepub fn print_cargo_args(&self)
pub fn print_cargo_args(&self)
Print to rb_config output for cargo
sourcepub fn push_dldflags(&mut self, input: &str) -> &mut Self
pub fn push_dldflags(&mut self, input: &str) -> &mut Self
Adds items to the rb_config based on a string from LDFLAGS/DLDFLAGS
sourcepub fn set_value_for_key(&mut self, key: &str, value: String)
pub fn set_value_for_key(&mut self, key: &str, value: String)
Sets a value for a key
Trait Implementations
impl Eq for RbConfig
impl StructuralEq for RbConfig
impl StructuralPartialEq for RbConfig
Auto Trait Implementations
impl RefUnwindSafe for RbConfig
impl Send for RbConfig
impl Sync for RbConfig
impl Unpin for RbConfig
impl UnwindSafe for RbConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more