[][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 Clone for WeldConf[src]

impl Debug for WeldConf[src]

impl Default for WeldConf[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.