[][src]Struct weld::WeldConf

pub struct WeldConf { /* fields omitted */ }

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

impl Default for WeldConf[src]

impl Clone for WeldConf[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for WeldConf[src]

Auto Trait Implementations

impl Send for WeldConf

impl Sync for WeldConf

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]