Skip to main content

Program

Struct Program 

Source
pub struct Program { /* private fields */ }
Expand description

A program compiled once, to run over many documents.

Implementations§

Source§

impl Program

Source

pub fn new(source: Source, options: ProgramOptions) -> Result<Program, Fail>

Compile source to run as the options say. A program that does not read, resolve or check is refused here, and so is a render it cannot take, before any document is read.

Source

pub fn run<R, W>(&self, input: R, output: W) -> Result<(), Fail>
where R: Read + Send + 'static, W: Write + Send + 'static,

Run the program over what input gives, writing its output to output as it goes. A failure is as Translation::run reports one.

Source

pub fn run_with_abort<R, W>( &self, input: R, output: W, abort: &Abort, ) -> Result<(), Fail>
where R: Read + Send + 'static, W: Write + Send + 'static,

Program::run, stopped by abort.

Source

pub fn run_str(&self, input: &str) -> Result<String, Fail>

What the program writes over input, as a string.

Trait Implementations§

Source§

impl Debug for Program

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Program

§

impl !UnwindSafe for Program

§

impl Forget for Program

§

impl Freeze for Program
where *const ArcInner<Resolved> is !null: Freeze, PhantomData<ArcInner<Resolved>>: Freeze, *const ArcInner<[(Arc<str>, Arc<str>)]> is !null: Freeze, PhantomData<ArcInner<[(Arc<str>, Arc<str>)]>>: Freeze, *const ArcInner<Atomic<bool>> is !null: Freeze, PhantomData<ArcInner<Atomic<bool>>>: Freeze, *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const ArcInner<Rope> is !null: Freeze, PhantomData<ArcInner<Rope>>: Freeze, *const ArcInner<Trie<Val, Size>> is !null: Freeze, PhantomData<ArcInner<Trie<Val, Size>>>: Freeze, *const ArcInner<[Val]> is !null: Freeze, PhantomData<ArcInner<[Val]>>: Freeze, *const ArcInner<IndexMap<Arc<str>, Val>> is !null: Freeze, PhantomData<ArcInner<IndexMap<Arc<str>, Val>>>: Freeze, *const ArcInner<Closure> is !null: Freeze, PhantomData<ArcInner<Closure>>: Freeze, &'static Native: Freeze, *const ArcInner<Partial> is !null: Freeze, PhantomData<ArcInner<Partial>>: Freeze, *const ArcInner<Selector> is !null: Freeze, PhantomData<ArcInner<Selector>>: Freeze, *const ArcInner<CaptureSpec> is !null: Freeze, PhantomData<ArcInner<CaptureSpec>>: Freeze, *const ArcInner<Plan> is !null: Freeze, PhantomData<ArcInner<Plan>>: Freeze, *const ArcInner<dyn Routers<Val>> is !null: Freeze, PhantomData<ArcInner<dyn Routers<Val>>>: Freeze, *const ArcInner<dyn Renderers> is !null: Freeze, PhantomData<ArcInner<dyn Renderers>>: Freeze, &'static Format: Freeze,

§

impl Move for Program

§

impl Send for Program
where Arc<Resolved>: Send, Arc<[(Arc<str>, Arc<str>)]>: Send, Arc<Atomic<bool>>: Send, Arc<str>: Send, Arc<Rope>: Send, Arc<Trie<Val, Size>>: Send, Arc<[Val]>: Send, Arc<IndexMap<Arc<str>, Val>>: Send, Arc<Closure>: Send, &'static Native: Send, Arc<Partial>: Send, Arc<Selector>: Send, Arc<CaptureSpec>: Send, Arc<Plan>: Send, Arc<dyn Routers<Val>>: Send, Arc<dyn Renderers>: Send, &'static Format: Send,

§

impl Sync for Program

§

impl Unpin for Program
where Arc<Resolved>: Unpin, Arc<[(Arc<str>, Arc<str>)]>: Unpin, Arc<Atomic<bool>>: Unpin, Arc<str>: Unpin, Arc<Rope>: Unpin, Arc<Trie<Val, Size>>: Unpin, Arc<[Val]>: Unpin, Arc<IndexMap<Arc<str>, Val>>: Unpin, Arc<Closure>: Unpin, &'static Native: Unpin, Arc<Partial>: Unpin, Arc<Selector>: Unpin, Arc<CaptureSpec>: Unpin, Arc<Plan>: Unpin, Arc<dyn Routers<Val>>: Unpin, Arc<dyn Renderers>: Unpin, &'static Format: Unpin,

§

impl UnsafeUnpin for Program
where *const ArcInner<Resolved> is !null: UnsafeUnpin, PhantomData<ArcInner<Resolved>>: UnsafeUnpin, *const ArcInner<[(Arc<str>, Arc<str>)]> is !null: UnsafeUnpin, PhantomData<ArcInner<[(Arc<str>, Arc<str>)]>>: UnsafeUnpin, *const ArcInner<Atomic<bool>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin, *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const ArcInner<Rope> is !null: UnsafeUnpin, PhantomData<ArcInner<Rope>>: UnsafeUnpin, *const ArcInner<Trie<Val, Size>> is !null: UnsafeUnpin, PhantomData<ArcInner<Trie<Val, Size>>>: UnsafeUnpin, *const ArcInner<[Val]> is !null: UnsafeUnpin, PhantomData<ArcInner<[Val]>>: UnsafeUnpin, *const ArcInner<IndexMap<Arc<str>, Val>> is !null: UnsafeUnpin, PhantomData<ArcInner<IndexMap<Arc<str>, Val>>>: UnsafeUnpin, *const ArcInner<Closure> is !null: UnsafeUnpin, PhantomData<ArcInner<Closure>>: UnsafeUnpin, &'static Native: UnsafeUnpin, *const ArcInner<Partial> is !null: UnsafeUnpin, PhantomData<ArcInner<Partial>>: UnsafeUnpin, *const ArcInner<Selector> is !null: UnsafeUnpin, PhantomData<ArcInner<Selector>>: UnsafeUnpin, *const ArcInner<CaptureSpec> is !null: UnsafeUnpin, PhantomData<ArcInner<CaptureSpec>>: UnsafeUnpin, *const ArcInner<Plan> is !null: UnsafeUnpin, PhantomData<ArcInner<Plan>>: UnsafeUnpin, *const ArcInner<dyn Routers<Val>> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Routers<Val>>>: UnsafeUnpin, *const ArcInner<dyn Renderers> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Renderers>>: UnsafeUnpin, &'static Format: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.