pub struct Exporter<'a, S: Sink> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, S: Sink> Exporter<'a, S>
impl<'a, S: Sink> Exporter<'a, S>
pub fn with_sink(env: &'a Env, sink: S) -> Self
Sourcepub fn resume(env: &'a Env, sink: S, mark: Mark) -> Result<Self>
pub fn resume(env: &'a Env, sink: S, mark: Mark) -> Result<Self>
Continue the export mark was taken from, on the same environment.
Sourcepub fn per_module(env: &'a Env, sink: S) -> Self
pub fn per_module(env: &'a Env, sink: S) -> Self
An exporter that writes one module at a time with Exporter::module, each to its
own sink after Exporter::split. A module’s records refer to what its imports
declare by name only.
Sourcepub fn module(&mut self, m: usize) -> Result<()>
pub fn module(&mut self, m: usize) -> Result<()>
Write every constant module m declares. Internal ones are included, since a later
module may need them.
Sourcepub fn split(&mut self, sink: S) -> Result<S::Output>
pub fn split(&mut self, sink: S) -> Result<S::Output>
End the current file and start the next on sink, with ids from the start again.
Returns the finished sink’s output.
Sourcepub const fn statements(self) -> Self
pub const fn statements(self) -> Self
Write every theorem as an axiom over its type, so an environment from
Env::load_statements exports its statements and what they rest on, with no
proofs.
pub fn meta(&mut self) -> Result<()>
Sourcepub fn meta_with(&mut self, module: Option<Value>) -> Result<()>
pub fn meta_with(&mut self, module: Option<Value>) -> Result<()>
The meta record, with module added under that key when given.
Sourcepub fn all(&mut self) -> Result<()>
pub fn all(&mut self) -> Result<()>
Export every non-internal constant in load order, like lean4export with no --.
pub const fn counts(&self) -> Counts
Sourcepub fn suspend(self) -> Result<(S::Output, Mark)>
pub fn suspend(self) -> Result<(S::Output, Mark)>
Like Exporter::finish, with a Mark to Exporter::resume from.
Sourcepub fn update(&mut self, r: &Reload) -> Result<()>
pub fn update(&mut self, r: &Reload) -> Result<()>
After Env::reload, export the reloaded constants again as Exporter::all would.
The end record counts every record since the first export.
An internal constant is written again if it was written before, since terms
already scanned will not lead back to it.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> Forget for Exporter<'a, S>
impl<'a, S> Freeze for Exporter<'a, S>where
S: Freeze,
impl<'a, S> RefUnwindSafe for Exporter<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for Exporter<'a, S>where
S: Send,
impl<'a, S> Sync for Exporter<'a, S>where
S: Sync,
impl<'a, S> Unpin for Exporter<'a, S>where
S: Unpin,
impl<'a, S> UnsafeUnpin for Exporter<'a, S>where
S: UnsafeUnpin,
impl<'a, S> UnwindSafe for Exporter<'a, S>where
S: UnwindSafe,
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
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