pub struct Page(pub TestResponse);Expand description
A rendered page.
Tuple Fields§
§0: TestResponseImplementations§
Source§impl Page
impl Page
pub fn status(&self) -> StatusCode
pub fn contains(&self, fragment: &str) -> bool
Sourcepub fn has_island(&self, id: &str) -> bool
pub fn has_island(&self, id: &str) -> bool
Whether an island host was emitted for id.
The server’s whole job for an island is putting this element in the document; if it isn’t there the island never mounts, and nothing else in a test would notice.
Sourcepub fn island_props(&self, id: &str) -> Option<Value>
pub fn island_props(&self, id: &str) -> Option<Value>
The props handed to an island, decoded from the attribute.
None when there is no such island, so a test distinguishes
“not rendered” from “rendered with nothing”.
pub fn header(&self, name: &str) -> Option<&str>
Sourcepub fn assert_status(&self, expected: StatusCode) -> &Self
pub fn assert_status(&self, expected: StatusCode) -> &Self
Assert the status, showing the body when it doesn’t match.
pub fn assert_ok(&self) -> &Self
Sourcepub fn assert_contains(&self, fragment: &str) -> &Self
pub fn assert_contains(&self, fragment: &str) -> &Self
Assert the HTML contains fragment, printing the document when
it doesn’t — a page test’s failure is unreadable without it.
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnsafeUnpin for Page
impl UnwindSafe for Page
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