pub struct Target {
pub cluster: ClusterId,
pub index: IndexName,
pub endpoint: Option<String>,
}Expand description
The physical destination of a single routed request.
Both fields are ids/names (never tenant values), so a Target is safe to
render in telemetry and /debug/explain (docs/05 §7).
§Examples
use osproxy_core::{ClusterId, IndexName, Target};
let target = Target::new(ClusterId::from("eu-1"), IndexName::from("logs-shared"));
assert_eq!(target.cluster.as_str(), "eu-1");
assert_eq!(target.to_string(), "eu-1/logs-shared");Fields§
§cluster: ClusterIdThe physical OpenSearch cluster the request is sent to.
index: IndexNameThe concrete (physical) index the request operates on.
endpoint: Option<String>The cluster’s base URL, supplied by the tenancy as part of the placement
result (the sink builds a pool for it on first use). None only in unit
tests that dispatch to an in-memory sink, which ignores it.
Excluded from identity (equality/hashing/Display): the endpoint is a
function of the cluster, not part of which target this is, so two ops
for the same cluster+index stay one demux key regardless of it.
Implementations§
Trait Implementations§
impl Eq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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