pub struct Binding(/* private fields */);Expand description
An extension bound to a document: its package, the input it reads and what
it last prepared from it. Clones share one state; a
snapshot does not.
Implementations§
Source§impl Binding
impl Binding
Sourcepub fn widget_urls(&self) -> BTreeMap<String, String>
pub fn widget_urls(&self) -> BTreeMap<String, String>
The address of each of the package’s widgets’ modules, by widget name.
Sourcepub fn style_urls(&self) -> Vec<String>
pub fn style_urls(&self) -> Vec<String>
The addresses of the package’s stylesheets.
Sourcepub fn view(&self, file: &Path) -> Result<Value>
pub fn view(&self, file: &Path) -> Result<Value>
The package’s view of file, a file it owns: its layout, title and
content.
Sourcepub fn snapshot(&self) -> Self
pub fn snapshot(&self) -> Self
Pin this render to its prepared revision while the watcher prepares the next.
Sourcepub fn owns(&self, file: &Path) -> bool
pub fn owns(&self, file: &Path) -> bool
Whether file is one the extension shows: its suffix is one the package
declared and, when file is absolute, it lies in the input.
Sourcepub fn prepare(&self) -> Result<bool>
pub fn prepare(&self) -> Result<bool>
Whether a new revision was prepared: the input is read again, and the package prepares from it unless it is unchanged, the last preparation succeeded and a revision is held. A failure to read or prepare is kept, and fails every call until a preparation succeeds; a reply without a revision fails only this preparation.
Sourcepub fn grammar(&self) -> Option<String>
pub fn grammar(&self) -> Option<String>
The syntax definition the package highlights its language with — None
when it brings none.
Sourcepub fn transform(&self, file: &Path, source: &str) -> Result<String>
pub fn transform(&self, file: &Path, source: &str) -> Result<String>
source, the page at file, as the package augments it — unchanged
when the reply has no source.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Binding
impl Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more