pub struct Wandbox { /* private fields */ }
Expand description
The main cache that holds on to the compiler cache
Implementations
sourceimpl Wandbox
impl Wandbox
sourcepub async fn new(
comps: Option<HashSet<String>>,
langs: Option<HashSet<String>>
) -> Result<Wandbox, Box<dyn Error>>
pub async fn new(
comps: Option<HashSet<String>>,
langs: Option<HashSet<String>>
) -> Result<Wandbox, Box<dyn Error>>
Initializes the cache for Wandbox requests
You may also choose to block certain compilers or languages from being supported. This is useful if wandbox has any issues with certain compilers or languages.
Arguments
comps
- A vector of compiler identifiers that the library should ignorelangs
- A vector of language identifiers that the library should ignore
Example
ⓘ
use std::collections::HashSet;
use wandbox::Wandbox;
#[tokio::main]
async fn main() {
let mut set : HashSet<String> = HashSet::new();
set.insert(String::from("gcc-head"));
let wbox : Wandbox = match Wandbox::new(Some(set), None).await {
Ok(wbox) => wbox,
Err(e) => return println!("{}", e)
};
}
sourcepub fn get_compilers(&self, lang: &str) -> Option<Vec<Compiler>>
pub fn get_compilers(&self, lang: &str) -> Option<Vec<Compiler>>
Gets a list of compilers given a certain language
Arguments
lang
- The language identifier to return the compilers for
sourcepub fn get_languages(&self) -> Vec<Language>
pub fn get_languages(&self) -> Vec<Language>
Returns a list of every language
sourcepub fn is_valid_compiler_str(&self, c: &str) -> bool
pub fn is_valid_compiler_str(&self, c: &str) -> bool
Determines if the compiler string supplied is a valid compiler
Arguments
c
- compiler identifier to check for
pub fn get_compiler_language_str(&self, c: &str) -> Option<String>
pub fn is_valid_language(&self, l: &str) -> bool
pub fn get_default_compiler(&self, l: &str) -> Option<String>
Auto Trait Implementations
impl RefUnwindSafe for Wandbox
impl Send for Wandbox
impl Sync for Wandbox
impl Unpin for Wandbox
impl UnwindSafe for Wandbox
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more