Skip to main content

ZoneConfigExt

Trait ZoneConfigExt 

Source
pub trait ZoneConfigExt {
    // Required methods
    fn new(id: String, max_cells: u32) -> Self;
    fn with_min_cells(self, min_cells: u32) -> Self;
}
Expand description

Extension trait for ZoneConfig helper methods

§Example

use peat_protocol::models::zone::{ZoneConfig, ZoneConfigExt};

let config = ZoneConfig::new("zone_north".to_string(), 10);
assert_eq!(config.max_cells, 10);
assert_eq!(config.min_cells, 2);

Required Methods§

Source

fn new(id: String, max_cells: u32) -> Self

Create a new zone configuration

§Arguments
  • id - Unique zone identifier
  • max_cells - Maximum number of cells allowed in zone
§Example
use peat_protocol::models::zone::{ZoneConfig, ZoneConfigExt};

let config = ZoneConfig::new("zone_alpha".to_string(), 8);
Source

fn with_min_cells(self, min_cells: u32) -> Self

Create configuration with custom minimum cells

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§