pub struct Apis { /* private fields */ }Expand description
Wire APIs by id: the built-ins plus any registered by extensions.
Implementations§
Source§impl Apis
impl Apis
Sourcepub fn register(&mut self, provider: Arc<dyn Provider>)
pub fn register(&mut self, provider: Arc<dyn Provider>)
Registers or replaces an implementation.
Sourcepub fn register_for(
&mut self,
provider: &str,
implementation: Arc<dyn Provider>,
)
pub fn register_for( &mut self, provider: &str, implementation: Arc<dyn Provider>, )
Streams the models of provider whose API is implementation’s with
implementation, ahead of every other implementation of that API
(pi’s streamSimple of an extension’s provider, which may serve
several APIs).
Sourcepub fn unregister_for(&mut self, provider: &str)
pub fn unregister_for(&mut self, provider: &str)
Drops the streams Apis::register_for added for provider.
Sourcepub fn stream(&self, request: Request) -> EventStream
pub fn stream(&self, request: Request) -> EventStream
Streams a request with the implementation of its model’s API, adding the headers some providers expect. An unknown API ends the stream with an error.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Apis
impl !UnwindSafe for Apis
impl Freeze for Apis
impl Send for Apis
impl Sync for Apis
impl Unpin for Apis
impl UnsafeUnpin for Apis
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