pub struct Charts { /* private fields */ }Expand description
Mounts the two scripts.
ⓘ
App::new()?.plugin(Charts::default())<script src="/vendor/chart/chart.umd.js" defer></script>
<script src="/vendor/chart/rustlavel-chart.js" defer></script>From this origin, not a CDN. default-src 'self' — the policy the auth
kit ships — refuses cdn.jsdelivr.net, and rightly: a CDN is a third party
who can change what your users execute. Vendoring is also what makes the
version above a fact rather than whatever the CDN served this morning.
Implementations§
Source§impl Charts
impl Charts
Sourcepub fn at(prefix: impl Into<String>) -> Charts
pub fn at(prefix: impl Into<String>) -> Charts
Mount somewhere else. The paths in CHART_JS_PATH and
INIT_JS_PATH are the defaults, so a template that hard-codes them
and a plugin that was moved will disagree — which is why both are
constants rather than strings written twice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Charts
impl RefUnwindSafe for Charts
impl Send for Charts
impl Sync for Charts
impl Unpin for Charts
impl UnsafeUnpin for Charts
impl UnwindSafe for Charts
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