pub struct FormatProxy {
pub format: &'static str,
pub proxy: &'static ProxyDef,
}Available on crate feature
alloc only.Expand description
A format-specific proxy definition.
This associates a format namespace (like “xml” or “json”) with a proxy definition.
Used to support #[facet(xml::proxy = XmlWrapper)] style attributes where different
formats need different proxy types for the same field or container.
§Resolution order
When serializing/deserializing, proxies are resolved in this order:
- Format-specific proxy (e.g.,
xml::proxywhen deserializing XML) - Format-agnostic proxy (
proxy) - Normal serialization/deserialization (no proxy)
§Example
ⓘ
#[derive(Facet)]
struct MyType {
#[facet(xml::proxy = XmlParameterProxy)]
#[facet(json::proxy = JsonParameterProxy)]
#[facet(proxy = DefaultProxy)] // fallback for other formats
parameter: Parameter,
}Fields§
§format: &'static strThe format namespace (e.g., “xml”, “json”).
proxy: &'static ProxyDefThe proxy definition for this format.
Trait Implementations§
Source§impl Clone for FormatProxy
impl Clone for FormatProxy
Source§fn clone(&self) -> FormatProxy
fn clone(&self) -> FormatProxy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FormatProxy
impl Debug for FormatProxy
impl Copy for FormatProxy
Auto Trait Implementations§
impl Freeze for FormatProxy
impl RefUnwindSafe for FormatProxy
impl Send for FormatProxy
impl Sync for FormatProxy
impl Unpin for FormatProxy
impl UnwindSafe for FormatProxy
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