Skip to content

OpaqueHandle: complete the type so opaque values can go in collections #35

Description

@loreste

OpaqueHandle appears in the map value type list in 0.5.4 error messages but is not usable:

let mut m = make(map[string]OpaqueHandle)  // fails
let h: OpaqueHandle = conn                 // fails: expected OpaqueHandle, got TlsConn
let h = OpaqueHandle(conn)                 // fails: cannot find OpaqueHandle in scope

Use case: Madis multiplexed TLS worker needs to track thousands of concurrent TlsConn objects in a map. Currently requires a 150-line C bridge that stores void* pointers in a static array and exposes int handles.

What is needed:

  • Cast/wrap: OpaqueHandle(conn) or opaque_wrap(conn) -> OpaqueHandle
  • Unwrap: opaque_unwrap[TlsConn](handle) or typed accessor
  • Collections: map[string]OpaqueHandle and []OpaqueHandle

Alternative: expose server-side TLS as int handles (tls_server_pool_accept) matching the client-side tls_pool pattern. See issue #33 for context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions