pub struct Session(/* private fields */);Expand description
Drives a router exactly as a webview would, without one.
Testing a topcoat router with Router::handle skips everything this plugin
adds: the origin rewrite, the redirect following, and the refusal of a
response the transport cannot carry. A Session runs all three on a plain
async call with no window, so a test fails where the application would.
Built by Builder::session, so a test cannot be configured differently
from the application it stands in for.
let session = Builder::new(Router::builder()).session(Platform::Scheme)?;
let response = session
.serve(http::Request::get("topcoat://localhost/").body(Vec::new())?)
.await;
assert_eq!(response.status(), 200);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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