dynamo-runtime 1.6.1

Dynamo Runtime Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

pub use crate::pipeline::network::tcp::{client, server};

/// Opaque TCP request path for an endpoint instance, shared by discovery and ingress.
/// Escape separators and literal percent signs so field boundaries remain unambiguous.
pub(crate) fn instance_path(endpoint: &crate::protocols::EndpointId, instance_id: u64) -> String {
    let escape = |field: &str| field.replace('%', "%25").replace('/', "%2F");
    format!(
        "{instance_id:x}/{}/{}/{}",
        escape(&endpoint.namespace),
        escape(&endpoint.component),
        escape(&endpoint.name),
    )
}