pub struct ReferencePage {
pub surface: &'static str,
pub module: String,
pub path: String,
}Expand description
A page of the crate’s reference: the web surface that publishes it and the page within it, as the rustdoc check derives it from the crate’s own inventory.
The mount is deliberately not here. Whether the reference is composed into a build, and
at which mount, is the build’s fact — scripts/site-build records every surface it
composed in data/build.json — so a page links this one only when the build that
renders it carries the surface, and at the mount it was composed at.
use majordomus_cli::site::ReferencePage;
use majordomus_cli::web::discover::RUSTDOC;
let page = ReferencePage {
surface: RUSTDOC,
module: "majordomus_cli::capability::builtin::quality".into(),
path: "majordomus_cli/capability/builtin/quality/index.html".into(),
};
let v = serde_json::to_value(&page).unwrap();
assert_eq!(v["surface"], "rustdoc");
// relative to the surface: the mount is the build's, joined by the page that links it
assert!(!v["path"].as_str().unwrap().starts_with('/'));Fields§
§surface: &'static strThe web surface the page is published under: crate::web::discover::RUSTDOC.
module: StringThe Rust module’s crate path: majordomus_cli::capability::builtin::quality.
path: StringThe page, relative to the surface’s root:
majordomus_cli/capability/builtin/quality/index.html.
Trait Implementations§
Source§impl Clone for ReferencePage
impl Clone for ReferencePage
Source§fn clone(&self) -> ReferencePage
fn clone(&self) -> ReferencePage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReferencePage
impl Debug for ReferencePage
Auto Trait Implementations§
impl Freeze for ReferencePage
impl RefUnwindSafe for ReferencePage
impl Send for ReferencePage
impl Sync for ReferencePage
impl Unpin for ReferencePage
impl UnsafeUnpin for ReferencePage
impl UnwindSafe for ReferencePage
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