[][src]Struct c2rust_refactor::command::RefactorState

pub struct RefactorState { /* fields omitted */ }

Stores the overall state of the refactoring process, which can be read and updated by Commands.

Methods

impl RefactorState[src]

pub fn new(
    config: Config,
    cmd_reg: Registry,
    file_io: Arc<dyn FileIO + Sync + Send>,
    marks: HashSet<(NodeId, Symbol)>
) -> RefactorState
[src]

pub fn session(&self) -> &Session[src]

pub fn source_map(&self) -> &SourceMap[src]

pub fn load_crate(&mut self)[src]

Load the crate from disk. This also resets a bunch of internal state, since we won't be rewriting with the previous orig_crate any more.

pub fn save_crate(&mut self)[src]

Save the crate to disk, by writing out the new source text produced by rewriting.

Note that we allow multiple calls to save_crate with no intervening load_crate. The later save_crates will simply keep using the original source text (even if it no longer matches the text on disk) as the basis for rewriting.

pub fn transform_crate<F, R>(&mut self, phase: Phase, f: F) -> Result<R> where
    F: FnOnce(&CommandState, &RefactorCtxt) -> R, 
[src]

pub fn run_typeck_loop<F>(&mut self, func: F) -> Result<(), &'static str> where
    F: FnMut(&mut Crate, &CommandState, &RefactorCtxt) -> TypeckLoopResult
[src]

pub fn clear_marks(&mut self)[src]

pub fn run<S: AsRef<str>>(
    &mut self,
    cmd: &str,
    args: &[S]
) -> Result<(), String>
[src]

Invoke a registered command with the given command name and arguments.

pub fn marks(&self) -> Ref<HashSet<(NodeId, Symbol)>>[src]

pub fn marks_mut(&mut self) -> RefMut<HashSet<(NodeId, Symbol)>>[src]

Trait Implementations

impl UserData for RefactorState[src]

Refactoring context

Auto Trait Implementations

Blanket Implementations

impl<T> Lone for T[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> Make for T[src]

impl<T> Slottable for T[src]