pub struct BrowserSession { /* private fields */ }Expand description
Session targeting a browser backend (WebGpu preferred, then OpenGl, then Cpu).
Implementations§
Source§impl BrowserSession
impl BrowserSession
Sourcepub fn new_preferred() -> Result<Self, BrowserError>
pub fn new_preferred() -> Result<Self, BrowserError>
Use the highest-priority available browser backend.
Sourcepub fn new(device: Device) -> Result<Self, BrowserError>
pub fn new(device: Device) -> Result<Self, BrowserError>
Target a specific browser backend.
Sourcepub fn compile_for_graph(
graph: &Graph,
) -> Result<BrowserCompiledGraph, BrowserError>
pub fn compile_for_graph( graph: &Graph, ) -> Result<BrowserCompiledGraph, BrowserError>
Compile for a specific graph, auto-selecting WebGPU vs WebGL fallback.
pub fn device(&self) -> Device
Sourcepub fn compile(
&self,
graph: Graph,
) -> Result<BrowserCompiledGraph, BrowserError>
pub fn compile( &self, graph: Graph, ) -> Result<BrowserCompiledGraph, BrowserError>
Compile graph on the selected browser backend.
Auto Trait Implementations§
impl Freeze for BrowserSession
impl RefUnwindSafe for BrowserSession
impl Send for BrowserSession
impl Sync for BrowserSession
impl Unpin for BrowserSession
impl UnsafeUnpin for BrowserSession
impl UnwindSafe for BrowserSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more