[−][src]Struct c2rust_refactor::command::RefactorState
Stores the overall state of the refactoring process, which can be read and updated by
Command
s.
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]
config: Config,
cmd_reg: Registry,
file_io: Arc<dyn FileIO + Sync + Send>,
marks: HashSet<(NodeId, Symbol)>
) -> RefactorState
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_crate
s 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]
F: FnOnce(&CommandState, &RefactorCtxt) -> R,
pub fn run_typeck_loop<F>(&mut self, func: F) -> Result<(), &'static str> where
F: FnMut(&mut Crate, &CommandState, &RefactorCtxt) -> TypeckLoopResult,
[src]
F: FnMut(&mut Crate, &CommandState, &RefactorCtxt) -> TypeckLoopResult,
pub fn clear_marks(&mut self)
[src]
pub fn run<S: AsRef<str>>(
&mut self,
cmd: &str,
args: &[S]
) -> Result<(), String>
[src]
&mut self,
cmd: &str,
args: &[S]
) -> Result<(), String>
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
fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M)
[src]
Auto Trait Implementations
impl !Send for RefactorState
impl !Sync for RefactorState
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]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> Erased for T
[src]
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
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]
T: ?Sized,