pub struct TranslationMap {
pub source_context: String,
pub target_context: String,
/* private fields */
}Expand description
Tracks the porting status of symbols from one context to another.
Symbols are keyed by their source name. Calling record
with a source name that already exists will update the existing mapping
rather than creating a duplicate.
Fields§
§source_context: StringContext ID of the source codebase.
target_context: StringContext ID of the target codebase.
Implementations§
Source§impl TranslationMap
impl TranslationMap
Sourcepub fn new(source_context: String, target_context: String) -> Self
pub fn new(source_context: String, target_context: String) -> Self
Create an empty translation map between two contexts.
Sourcepub fn record(
&mut self,
source: &str,
target: Option<&str>,
status: TranslationStatus,
notes: Option<String>,
)
pub fn record( &mut self, source: &str, target: Option<&str>, status: TranslationStatus, notes: Option<String>, )
Record or update a translation mapping.
If a mapping for source already exists it is updated in place;
otherwise a new entry is appended.
Sourcepub fn status(&self, source: &str) -> Option<&TranslationMapping>
pub fn status(&self, source: &str) -> Option<&TranslationMapping>
Look up the current mapping for a source symbol.
Sourcepub fn progress(&self) -> TranslationProgress
pub fn progress(&self) -> TranslationProgress
Compute aggregate progress across all tracked symbols.
Sourcepub fn remaining(&self) -> Vec<&TranslationMapping>
pub fn remaining(&self) -> Vec<&TranslationMapping>
Return all mappings that still need work (NotStarted
or InProgress).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TranslationMap
impl RefUnwindSafe for TranslationMap
impl Send for TranslationMap
impl Sync for TranslationMap
impl Unpin for TranslationMap
impl UnsafeUnpin for TranslationMap
impl UnwindSafe for TranslationMap
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