pub struct Masked {
pub toml: String,
/* private fields */
}Expand description
Masks the !alias(…) profiles of TOML definitions from before 0.27, for their migration.
Masks the !alias(…) profiles of TOML definitions from before 0.27, for their migration.
Masks the !alias(…) profiles of TOML definitions from before 0.27, for their migration.
Fields§
§toml: StringValid TOML with each value-position !alias / !alias(...) replaced by a unique string.
Implementations§
Source§impl Masked
impl Masked
pub fn invocations(&self) -> &[AliasInvocation]
Sourcepub fn invocation_index(&self, value: &str) -> Option<usize>
pub fn invocation_index(&self, value: &str) -> Option<usize>
Return the invocation index if value is a placeholder emitted by mask.
Sourcepub fn original_offset(&self, masked_offset: usize) -> usize
pub fn original_offset(&self, masked_offset: usize) -> usize
Map a byte offset in Self::toml back to its byte offset in the original source.
Sourcepub fn unmask(&self, edited: &str, original_source: &str) -> String
pub fn unmask(&self, edited: &str, original_source: &str) -> String
Restore each placeholder in edited back to its exact original slice from original_source.
Sourcepub fn unmask_with(
&self,
serialized: &str,
replacement: impl Fn(usize, &AliasInvocation) -> String,
) -> String
pub fn unmask_with( &self, serialized: &str, replacement: impl Fn(usize, &AliasInvocation) -> String, ) -> String
Replace each placeholder string literal in serialized using replacement.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Masked
impl Freeze for Maskedwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<AliasInvocation>: Freeze,
PhantomData<(Range<usize>, Range<usize>)>: Freeze,
impl Move for Masked
impl RefUnwindSafe for Masked
impl Send for Maskedwhere
RawVecInner: Send,
impl Sync for Maskedwhere
RawVecInner: Sync,
impl Unpin for Masked
impl UnsafeUnpin for Maskedwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<AliasInvocation>: UnsafeUnpin,
PhantomData<(Range<usize>, Range<usize>)>: UnsafeUnpin,
impl UnwindSafe for Maskedwhere
RawVecInner: UnwindSafe,
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