---
source: tests/backends_swift_snapshot_test.rs
expression: "&file.content"
---
// Generated by alef. Do not edit by hand.
// swift-format-ignore-file
// This file is in Sources/RustBridge/ because the swift-bridge @_cdecl
// shims reference SwiftMarkupCallbackBox by name and must see it in the same module.

import RustBridgeC
/// Delegate protocol for `SwiftMarkupCallbackBox`.
/// Conforming types convert raw FFI params (RustString etc.) to user-friendly
/// Swift types and return a JSON-encoded result string.
/// Implemented by the private adapter class in the `MarkupCallback` module.
///
/// Leading `_` flags this as an internal binding surface — not part of the
/// user-facing API. Must remain `public` because Swift requires public visibility
/// for cross-module protocol conformance (implementer lives in the main target).
public protocol _SwiftMarkupCallbackBoxDelegate: AnyObject {
    func visitNode(_ tag: RustString) -> String
}

/// Opaque box class retained by Rust via `Unmanaged<SwiftMarkupCallbackBox>.passRetained`.
/// Each `alef_*` method corresponds to an `extern "Swift"` declaration in the
/// Rust bridge crate; swift-bridge generates @_cdecl shims that call these.
/// Delegates to a `_SwiftMarkupCallbackBoxDelegate` (implemented in the main module).
public final class SwiftMarkupCallbackBox {
    private let delegate: any _SwiftMarkupCallbackBoxDelegate
    public init(_ delegate: any _SwiftMarkupCallbackBoxDelegate) { self.delegate = delegate }
    public func alef_visit_node(tag: RustString) -> String {
        return delegate.visitNode(tag)
    }
}
