pub struct Block {
pub file: String,
pub file_hash: String,
pub name: String,
pub path: Vec<String>,
pub imports: Vec<String>,
pub uses: Vec<Vec<String>>,
pub source: String,
pub line: usize,
}Expand description
A lean! block found in the crate.
Fields§
§file: StringPath of the Rust file relative to the crate root (src/lib.rs).
file_hash: Stringsyntax::file_hash of file.
name: StringName of the Rust module (and of the Lean namespace).
path: Vec<String>Rust module path of the block (crate::geometry::shapes as segments after crate).
imports: Vec<String>§uses: Vec<Vec<String>>The blocks this one uses, as module paths.
source: StringThe Lean source as written (before removing the common indentation).
line: usizeLine of the Rust file where the source literal starts.
Implementations§
Source§impl Block
impl Block
Sourcepub fn lean_module(&self, crate_ident: &str) -> String
pub fn lean_module(&self, crate_ident: &str) -> String
LeanRustGen.Embed.<crate>.h<file hash>.<name>.
Sourcepub fn lean_file(&self, crate_ident: &str) -> PathBuf
pub fn lean_file(&self, crate_ident: &str) -> PathBuf
Path of the Lean file in the Lean package.
Sourcepub fn uses_instances(&self) -> bool
pub fn uses_instances(&self) -> bool
true when the source uses rust_instances, which imports INSTANCES_MODULE.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Block
impl Freeze for Blockwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Vec<String>>: Freeze,
impl Move for Block
impl RefUnwindSafe for Block
impl Send for Blockwhere
RawVecInner: Send,
impl Sync for Blockwhere
RawVecInner: Sync,
impl Unpin for Block
impl UnsafeUnpin for Blockwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Vec<String>>: UnsafeUnpin,
impl UnwindSafe for Blockwhere
RawVecInner: 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
Mutably borrows from an owned value. Read more