pub struct SourceString { /* private fields */ }Expand description
Structure for managing parsing QASM from a string with no associated
source file. fake_file_path contains something like “no file” and is
present in order to make it easier to avoid duplicating code supporing
QASM read from source files.
Implementations§
Source§impl SourceString
impl SourceString
pub fn new<T: AsRef<str>, P: AsRef<Path>>( source: T, fake_file_path: P, syntax_ast: ParseOrErrors<SourceFile>, included: Vec<SourceFile>, ) -> SourceString
pub fn fake_file_path(&self) -> &PathBuf
pub fn source(&self) -> &str
Trait Implementations§
Source§impl Clone for SourceString
impl Clone for SourceString
Source§fn clone(&self) -> SourceString
fn clone(&self) -> SourceString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceString
impl Debug for SourceString
Source§impl SourceTrait for SourceString
impl SourceTrait for SourceString
fn syntax_ast(&self) -> &ParseOrErrors<SourceFile>
fn included(&self) -> &Vec<SourceFile>
fn file_path(&self) -> PathBuf
fn print_syntax_errors(&self)
Source§fn any_parse_errors(&self) -> bool
fn any_parse_errors(&self) -> bool
Return
true if the source file or any included files produced a parse error.Auto Trait Implementations§
impl Freeze for SourceString
impl RefUnwindSafe for SourceString
impl Send for SourceString
impl Sync for SourceString
impl Unpin for SourceString
impl UnwindSafe for SourceString
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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