pub struct CpClient { /* private fields */ }Expand description
Outbound client to a control plane’s per-tenant edge API.
Implementations§
Source§impl CpClient
impl CpClient
Sourcepub fn from_cfg(cfg: &ControlPlaneCfg) -> Result<Option<Arc<CpClient>>>
pub fn from_cfg(cfg: &ControlPlaneCfg) -> Result<Option<Arc<CpClient>>>
Build the client if managed mode is enabled and configured; otherwise None. Fails fast on
an enabled-but-incomplete config so a misconfigured edge doesn’t silently run unmanaged.
Sourcepub async fn pull_policy(&self, etag: Option<&str>) -> Result<PullResult>
pub async fn pull_policy(&self, etag: Option<&str>) -> Result<PullResult>
Conditional policy pull. 200 → Policy; 304 → NotModified; other statuses → Err.
Sourcepub async fn report_usage(&self, delta: &UsageDelta) -> Result<()>
pub async fn report_usage(&self, delta: &UsageDelta) -> Result<()>
Report a usage delta.
Sourcepub async fn forward_csp(&self, raw: &Bytes)
pub async fn forward_csp(&self, raw: &Bytes)
Forward a raw CSP report body (best-effort; errors are logged, never surfaced).
Auto Trait Implementations§
impl !RefUnwindSafe for CpClient
impl !UnwindSafe for CpClient
impl Freeze for CpClient
impl Send for CpClient
impl Sync for CpClient
impl Unpin for CpClient
impl UnsafeUnpin for CpClient
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