[−][src]Struct weld::WeldConf
A struct used to configure compilation and the Weld runtime.
Methods
impl WeldConf
[src]
pub fn new() -> WeldConf
[src]
Creates a new empty WeldConf
.
Weld configurations are unstructured key/value pairs. The configuration is used to modify how a Weld program is compiled (e.g., setting multi-thread support, configuring optimization passes, etc.) and how a Weld program is run (e.g., a memory limit, the number of threads to allocate the run, etc.).
Examples
use weld::WeldConf; let conf = WeldConf::new();
pub fn set<K: Into<String>, V: Into<Vec<u8>>>(&mut self, key: K, value: V)
[src]
Adds a configuration to this WeldConf
.
This method does not perform any checks to ensure that the key/value pairs are valid. If
a WeldConf
contains an invalid configuration option, the WeldModule
methods that
compile and run modules will fail with an error.
Examples
use weld::WeldConf; let mut conf = WeldConf::new(); conf.set("weld.memory.limit", "1024"); // Invalid key/value pairs are also allowed but may raise errors. conf.set("weld.madeUpConfig", "madeUpValue");
pub fn get(&self, key: &str) -> Option<&CString>
[src]
Get the value of the given key, or None
if it is not set.
Examples
use weld::WeldConf; let mut conf = WeldConf::new(); conf.set("weld.memory.limit", "1024"); let value = conf.get("weld.memory.limit").unwrap().to_str().unwrap(); assert_eq!(value, "1024"); let value = conf.get("non-existant key"); assert!(value.is_none());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WeldConf
impl Send for WeldConf
impl Sync for WeldConf
impl Unpin for WeldConf
impl UnwindSafe for WeldConf
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,