[−][src]Struct kaze::Context
A top-level container/owner object for a Module
graph.
A Context
owns all parts of a module graph, and provides an API for creating Module
objects.
Examples
use kaze::*; let c = Context::new(); let m = c.module("MyModule"); m.output("out", m.input("in", 1));
Methods
impl<'a> Context<'a>
[src]
pub fn new() -> Context<'a>
[src]
pub fn module<S: Into<String>>(&'a self, name: S) -> &Module
[src]
Creates a new Module
called name
in this Context
.
Conventionally, name
should be CamelCase
, though this is not enforced.
Panics
Panics if a Module
with the same name
already exists in this Context
.
Examples
use kaze::*; let c = Context::new(); let my_module = c.module("MyModule"); let another_mod = c.module("AnotherMod");
The following example panics by creating a Module
with the same name
as a previously-created Module
in the same Context
:
use kaze::*; let c = Context::new(); let _ = c.module("A"); // Unique name, OK let _ = c.module("B"); // Unique name, OK let _ = c.module("A"); // Non-unique name, panic!
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Context<'a>
impl<'a> !Send for Context<'a>
impl<'a> !Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
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, 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>,