pub trait FloatingIpProvider: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn resolve_target<'life0, 'life1, 'async_trait>(
&'life0 self,
machine: &'life1 FloatingIpMachine,
) -> Pin<Box<dyn Future<Output = Result<FloatingIpTarget, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn current_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
ip_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<FloatingIpState, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn reassign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ip_id: &'life1 str,
target: &'life2 FloatingIpTarget,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
}Expand description
One provider’s floating/reserved-IP transport + mobility policy.
Implementors ship in yah-floating-ip-adapters: HetznerFloatingIp,
OvhFloatingIp, VultrFloatingIp (R859-F3).
Required Methods§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
Provider id, e.g. "hetzner" — matches
FloatingIpMachine::provider.
Sourcefn resolve_target<'life0, 'life1, 'async_trait>(
&'life0 self,
machine: &'life1 FloatingIpMachine,
) -> Pin<Box<dyn Future<Output = Result<FloatingIpTarget, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn resolve_target<'life0, 'life1, 'async_trait>(
&'life0 self,
machine: &'life1 FloatingIpMachine,
) -> Pin<Box<dyn Future<Output = Result<FloatingIpTarget, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Resolve a target machine into this provider’s native attach identifier (server id / serviceName / instance UUID) plus the mobility zone it lives in. May hit the provider’s API (e.g. a name→id lookup) — this is a live-data resolution step, not a pure function of the declaration.
Sourcefn current_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
ip_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<FloatingIpState, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn current_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
ip_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<FloatingIpState, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Current state of the floating/reserved IP: its home zone (fixed for the IP’s lifetime) and the provider-native id of whatever it’s attached to right now, if anything.
Sourcefn reassign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ip_id: &'life1 str,
target: &'life2 FloatingIpTarget,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn reassign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ip_id: &'life1 str,
target: &'life2 FloatingIpTarget,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Actually move the IP. Callers (namely reconcile_assignment)
have already checked idempotency and zone match before calling
this — it always issues the provider call.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".