pub struct Models(/* private fields */);Expand description
A cloneable model capability. Clones retain the originating process session; constructing another process does not replace it. Browser backends need not be Send.
Implementations§
Source§impl Models
impl Models
Sourcepub fn new(backend: Rc<dyn ModelBackend>) -> Self
pub fn new(backend: Rc<dyn ModelBackend>) -> Self
The process must authenticate and authorize this backend before injection.
Sourcepub fn from_launcher() -> Result<Self, ModelError>
pub fn from_launcher() -> Result<Self, ModelError>
Sourcepub fn stream<'a>(
&'a self,
request: &'a ModelRequest,
sink: StreamSink<'a>,
) -> CompletionFuture<'a>
pub fn stream<'a>( &'a self, request: &'a ModelRequest, sink: StreamSink<'a>, ) -> CompletionFuture<'a>
Stream presentation updates using only this process’s capability.
pub fn is_available(&self) -> bool
Sourcepub fn complete<'a>(&'a self, request: &'a ModelRequest) -> CompletionFuture<'a>
pub fn complete<'a>(&'a self, request: &'a ModelRequest) -> CompletionFuture<'a>
Complete without blocking the UI. No backend means unavailable, never
an ambient client, provider key lookup or fallback to another session.
The future is intentionally local: browser process capabilities are not Send.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Models
impl !Send for Models
impl !Sync for Models
impl !UnwindSafe for Models
impl Forget for Models
impl Freeze for Models
impl Move for Models
impl Unpin for Models
impl UnsafeUnpin for Models
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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