Sigil documentation
ReferenceRust referencesigil-nova

sigil-nova · spatial_zone

Source declarations, signatures and documentation for spatial_zone.

Source: sigil/node/sigil-nova/src/spatial_zone.rs. SHA-256: 6ca893abf32968ea858e27e85e912b9d088428506943168fa5dab7d34ac82f94.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

spatial_zone::SpatialZoneId

Unique spatial zone identifier.

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct SpatialZoneId(pub String);

Source line: 17.

spatial_zone::ZoneBoundary

Spherical boundary for a spatial zone.

#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct ZoneBoundary {
pub center: WorldPosition,
pub radius: f64
}

Source line: 21.

spatial_zone::SpatialZoneType

Type of spatial zone determining default behavior.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SpatialZoneType {
    Organization,
    Social,
    Commercial,
    Arena,
    Private,
}

Source line: 28.

spatial_zone::ZonePermissions

Permissions governing zone interactions.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ZonePermissions {
pub enter: AccessLevel,
pub interact: AccessLevel,
pub build: AccessLevel
}

Source line: 38.

spatial_zone::SpatialZone

A spatial zone owned by an organization in the Nova world.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SpatialZone {
pub id: SpatialZoneId,
pub org_did: String,
pub boundary: ZoneBoundary,
pub permissions: ZonePermissions,
pub zone_type: SpatialZoneType,
pub created_at: u64
}

Source line: 46.

spatial_zone::SpatialZoneRegistry

On-chain registry of spatial zones.

#[derive(Debug, Clone, Default)]
pub struct SpatialZoneRegistry {

}

Source line: 57.

spatial_zone::SpatialZoneRegistry::new

Create an empty zone registry.

pub fn new() -> Self;

Source line: 63.

spatial_zone::SpatialZoneRegistry::create_zone

Create a new spatial zone.

pub fn create_zone(
        &mut self,
        org_did: &str,
        boundary: ZoneBoundary,
        zone_type: SpatialZoneType,
        timestamp: u64,
    ) -> Result<SpatialZone, NovaError>;

Source line: 68.

spatial_zone::SpatialZoneRegistry::is_in_zone

Check if a position falls within a zone.

pub fn is_in_zone(position: &WorldPosition, zone: &SpatialZone) -> bool;

Source line: 115.

spatial_zone::SpatialZoneRegistry::get_zones_at

Get all zones that contain the given position.

pub fn get_zones_at(&self, position: &WorldPosition) -> Vec<&SpatialZone>;

Source line: 124.

spatial_zone::SpatialZoneRegistry::update_zone_permissions

Update the permissions on a zone. Only the owner may modify.

pub fn update_zone_permissions(
        &mut self,
        zone_id: &SpatialZoneId,
        caller_did: &str,
        perms: ZonePermissions,
    ) -> Result<(), NovaError>;

Source line: 132.

spatial_zone::SpatialZoneRegistry::delete_zone

Delete a zone, returning the removed zone.

pub fn delete_zone(
        &mut self,
        zone_id: &SpatialZoneId,
        caller_did: &str,
    ) -> Result<SpatialZone, NovaError>;

Source line: 155.

spatial_zone::SpatialZoneRegistry::get_zone

Get a zone by ID.

pub fn get_zone(&self, zone_id: &SpatialZoneId) -> Option<&SpatialZone>;

Source line: 178.

spatial_zone::SpatialZoneRegistry::zone_count

Total number of zones.

pub fn zone_count(&self) -> usize;

Source line: 183.

On this page