MCPcopy Create free account
hub / github.com/apache/fory / set_struct_context

Function set_struct_context

rust/fory-derive/src/object/util.rs:72–79  ·  view source on GitHub ↗

Set the macro context with struct name and debug flag.

(name: &str, debug_enabled: bool)

Source from the content-addressed store, hash-verified

70
71/// Set the macro context with struct name and debug flag.
72pub(super) fn set_struct_context(name: &str, debug_enabled: bool) {
73 MACRO_CONTEXT.with(|ctx| {
74 *ctx.borrow_mut() = Some(MacroContext {
75 struct_name: name.to_string(),
76 debug_enabled,
77 });
78 });
79}
80
81pub(super) fn clear_struct_context() {
82 MACRO_CONTEXT.with(|ctx| {

Callers 1

derive_serializerFunction · 0.85

Calls 2

SomeFunction · 0.85
to_stringMethod · 0.45

Tested by

no test coverage detected