Struct EncLogBuilder
pub struct EncLogBuilder { /* private fields */ }Expand description
Builder for constructing EncLog table entries
Provides a fluent interface for building EncLog metadata table entries.
These entries track Edit-and-Continue operations performed during debugging
sessions, recording which metadata elements were created, updated, or deleted.
§Required Fields
token_value: Metadata token identifying the affected elementfunc_code: Operation code (0=create, 1=update, 2=delete)
§Edit-and-Continue Context
The EncLog table is used by .NET’s Edit-and-Continue debugging feature to track all metadata changes made during debugging sessions. When developers modify code while debugging, the compiler generates new metadata and records the changes.
§Examples
use dotscope::prelude::*;
// Record creation of a new method
let create_method = EncLogBuilder::new()
.token_value(0x06000042) // MethodDef token
.func_code(0) // Create operation
.build(&mut assembly)?;
// Record update to an existing type
let update_type = EncLogBuilder::new()
.token_value(0x02000010) // TypeDef token
.func_code(1) // Update operation
.build(&mut assembly)?;
// Record deletion of a field
let delete_field = EncLogBuilder::new()
.token_value(0x04000025) // Field token
.func_code(2) // Delete operation
.build(&mut assembly)?;Implementations§
§impl EncLogBuilder
impl EncLogBuilder
pub fn new() -> Self
pub fn new() -> Self
Creates a new EncLogBuilder with default values
Initializes a new builder instance with all fields unset. The caller must provide both required fields before calling build().
§Returns
A new EncLogBuilder instance ready for configuration
§Examples
use dotscope::prelude::*;
let builder = EncLogBuilder::new();pub fn token_value(self, token_value: u32) -> Self
pub fn token_value(self, token_value: u32) -> Self
Sets the metadata token value
Specifies the metadata token that identifies which metadata element was affected by this Edit-and-Continue operation. The token format follows the standard structure: table_id (upper byte) + row_id (lower 3 bytes).
§Parameters
token_value: The metadata token identifying the affected element
§Returns
Self for method chaining
§Examples
use dotscope::prelude::*;
// Method token
let builder = EncLogBuilder::new()
.token_value(0x06000001); // MethodDef RID 1
// Type token
let builder = EncLogBuilder::new()
.token_value(0x02000005); // TypeDef RID 5
// Field token
let builder = EncLogBuilder::new()
.token_value(0x04000010); // Field RID 16pub fn func_code(self, func_code: u32) -> Self
pub fn func_code(self, func_code: u32) -> Self
Sets the function code
Specifies the type of Edit-and-Continue operation that was performed on the metadata element identified by the token.
§Parameters
func_code: The operation code
§Returns
Self for method chaining
§Operation Codes
0: Create - New metadata item added during edit session1: Update - Existing metadata item modified during edit session2: Delete - Metadata item marked for deletion during edit session
§Examples
use dotscope::prelude::*;
// Create operation
let builder = EncLogBuilder::new()
.func_code(0);
// Update operation
let builder = EncLogBuilder::new()
.func_code(1);
// Delete operation
let builder = EncLogBuilder::new()
.func_code(2);pub fn create(self) -> Self
pub fn create(self) -> Self
pub fn update(self) -> Self
pub fn update(self) -> Self
pub fn delete(self) -> Self
pub fn delete(self) -> Self
pub fn build(self, assembly: &mut CilAssembly) -> Result<ChangeRefRc>
pub fn build(self, assembly: &mut CilAssembly) -> Result<ChangeRefRc>
Builds and adds the EncLog entry to the metadata
Validates all required fields, creates the EncLog table entry,
and adds it to the assembly. Returns a token that can be used
to reference this edit log entry.
§Parameters
assembly: Mutable reference to the CilAssembly
§Returns
Ok(Token): Token referencing the created edit log entryErr(Error): If validation fails or table operations fail
§Errors
- Missing required field (token_value or func_code)
- Table operations fail due to metadata constraints
§Examples
use dotscope::prelude::*;
let mut assembly = CilAssembly::new(view);
let token = EncLogBuilder::new()
.token_value(0x06000001)
.func_code(1)
.build(&mut assembly)?;Trait Implementations§
§impl Clone for EncLogBuilder
impl Clone for EncLogBuilder
§fn clone(&self) -> EncLogBuilder
fn clone(&self) -> EncLogBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for EncLogBuilder
impl Debug for EncLogBuilder
§impl Default for EncLogBuilder
impl Default for EncLogBuilder
§fn default() -> Self
fn default() -> Self
Creates a default EncLogBuilder
Equivalent to calling EncLogBuilder::new().
Auto Trait Implementations§
impl Freeze for EncLogBuilder
impl RefUnwindSafe for EncLogBuilder
impl Send for EncLogBuilder
impl Sync for EncLogBuilder
impl Unpin for EncLogBuilder
impl UnsafeUnpin for EncLogBuilder
impl UnwindSafe for EncLogBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.