pub struct FoamFile {
pub header: Option<FoamHeader>,
pub dict: FoamDict,
}Expand description
A parsed OpenFOAM dictionary file: its FoamFile header (if present) and
the body of entries.
Fields§
§header: Option<FoamHeader>The FoamFile { … } header, or None if the file had none.
dict: FoamDictThe dictionary body.
Implementations§
Source§impl FoamFile
impl FoamFile
Sourcepub fn parse(text: &str) -> Result<Self, IoError>
pub fn parse(text: &str) -> Result<Self, IoError>
Parse dictionary text into a header (if any) and body.
Sourcepub fn parse_named(
text: &str,
context: impl Into<String>,
) -> Result<Self, IoError>
pub fn parse_named( text: &str, context: impl Into<String>, ) -> Result<Self, IoError>
Like Self::parse but labels parse errors with context.
Sourcepub fn read(path: impl AsRef<Path>) -> Result<Self, IoError>
pub fn read(path: impl AsRef<Path>) -> Result<Self, IoError>
Read and parse a dictionary file from path.
Sourcepub fn to_foam_string(&self) -> String
pub fn to_foam_string(&self) -> String
Serialise to OpenFOAM ASCII text (banner + header + body).
Trait Implementations§
impl StructuralPartialEq for FoamFile
Auto Trait Implementations§
impl Freeze for FoamFile
impl RefUnwindSafe for FoamFile
impl Send for FoamFile
impl Sync for FoamFile
impl Unpin for FoamFile
impl UnsafeUnpin for FoamFile
impl UnwindSafe for FoamFile
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