Sigil documentation
ReferenceRust referencesigil-nova

sigil-nova · parcel

Source declarations, signatures and documentation for parcel.

Source: sigil/node/sigil-nova/src/parcel.rs. SHA-256: 3729a56942282008c0d008e51511a650fda6efefa6fdaa4b2f79632792eb6bc8.

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.

parcel::ParcelId

Unique parcel identifier within a region.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct ParcelId {
pub region: RegionCoord,
pub local_x: u16,
pub local_z: u16
}

Source line: 18.

parcel::ParcelType

Type of land parcel determining usage rules.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ParcelType {
    Residential,
    Commercial,
    Public,
    Wilderness,
    Reserved,
}

Source line: 26.

parcel::ParcelOwnership

Ownership record for a single parcel.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ParcelOwnership {
pub parcel_id: ParcelId,
pub owner_did: String,
pub parcel_type: ParcelType,
pub acquired_at: u64,
pub rent_per_epoch: Option<u64>
}

Source line: 36.

parcel::ParcelRegistry

On-chain registry of all parcels with ownership indexes.

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

}

Source line: 46.

parcel::ParcelRegistry::new

Create an empty parcel registry.

pub fn new() -> Self;

Source line: 53.

parcel::ParcelRegistry::claim_parcel

Claim an unowned parcel.

pub fn claim_parcel(
        &mut self,
        parcel_id: ParcelId,
        owner_did: &str,
        parcel_type: ParcelType,
        timestamp: u64,
    ) -> Result<ParcelOwnership, NovaError>;

Source line: 58.

parcel::ParcelRegistry::transfer_parcel

Transfer parcel ownership from one DID to another.

pub fn transfer_parcel(
        &mut self,
        parcel_id: ParcelId,
        from_did: &str,
        to_did: &str,
    ) -> Result<(), NovaError>;

Source line: 92.

parcel::ParcelRegistry::get_parcels_by_owner

Get all parcels owned by a DID.

pub fn get_parcels_by_owner(&self, owner_did: &str) -> Vec<&ParcelOwnership>;

Source line: 137.

parcel::ParcelRegistry::get_parcels_in_region

Get all parcels within a given region.

pub fn get_parcels_in_region(&self, region: &RegionCoord) -> Vec<&ParcelOwnership>;

Source line: 145.

parcel::ParcelRegistry::is_available

Check whether a parcel is unclaimed.

pub fn is_available(&self, parcel_id: &ParcelId) -> bool;

Source line: 153.

parcel::ParcelRegistry::parcel_count

Total number of claimed parcels.

pub fn parcel_count(&self) -> usize;

Source line: 158.

parcel::validate_parcel_id

Validate that a parcel ID has local coordinates within bounds.

pub fn validate_parcel_id(id: &ParcelId) -> Result<bool, NovaError>;

Source line: 164.

On this page