#[non_exhaustive]pub enum AllocationStrategy {
Unspecified,
Random,
FirstAvailable,
RandomFirstNAvailable,
FirstSmallestFitting,
UnknownValue(UnknownValue),
}Expand description
Enumeration of range auto-allocation strategies
§Working with unknown values
This enum is defined as #[non_exhaustive] because Google Cloud may add
additional enum variants at any time. Adding new variants is not considered
a breaking change. Applications should write their code in anticipation of:
- New values appearing in future releases of the client library, and
- New values received dynamically, without application changes.
Please consult the Working with enums section in the user guide for some guidelines.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unspecified
Unspecified is the only valid option when the range is specified explicitly by ip_cidr_range field. Otherwise unspefified means using the default strategy.
Random
Random strategy, the legacy algorithm, used for backwards compatibility. This allocation strategy remains efficient in the case of concurrent allocation requests in the same peered network space and doesn’t require providing the level of concurrency in an explicit parameter, but it is prone to fragmenting available address space.
FirstAvailable
Pick the first available address range. This strategy is deterministic and the result is easy to predict.
RandomFirstNAvailable
Pick an arbitrary range out of the first N available ones. The N will be set in the first_available_ranges_lookup_size field. This strategy should be used when concurrent allocation requests are made in the same space of peered networks while the fragmentation of the addrress space is reduced.
FirstSmallestFitting
Pick the smallest but fitting available range. This deterministic strategy minimizes fragmentation of the address space.
UnknownValue(UnknownValue)
If set, the enum was initialized with an unknown value.
Applications can examine the value using AllocationStrategy::value or AllocationStrategy::name.
Implementations§
Trait Implementations§
Source§impl Clone for AllocationStrategy
impl Clone for AllocationStrategy
Source§fn clone(&self) -> AllocationStrategy
fn clone(&self) -> AllocationStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AllocationStrategy
impl Debug for AllocationStrategy
Source§impl Default for AllocationStrategy
impl Default for AllocationStrategy
Source§impl<'de> Deserialize<'de> for AllocationStrategy
impl<'de> Deserialize<'de> for AllocationStrategy
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for AllocationStrategy
impl Display for AllocationStrategy
Source§impl From<&str> for AllocationStrategy
impl From<&str> for AllocationStrategy
Source§impl From<i32> for AllocationStrategy
impl From<i32> for AllocationStrategy
Source§impl PartialEq for AllocationStrategy
impl PartialEq for AllocationStrategy
Source§impl Serialize for AllocationStrategy
impl Serialize for AllocationStrategy
impl StructuralPartialEq for AllocationStrategy
Auto Trait Implementations§
impl Freeze for AllocationStrategy
impl RefUnwindSafe for AllocationStrategy
impl Send for AllocationStrategy
impl Sync for AllocationStrategy
impl Unpin for AllocationStrategy
impl UnwindSafe for AllocationStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.