pub trait Frame: Anchor {
fn frame_type(&self) -> FrameType;
fn is_compatible_with(&self, other: &dyn Frame) -> bool {
self.frame_type() == other.frame_type()
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FrameType {
Reference,
Perspective,
Access,
Execution,
Ambiguous,
}
pub trait ReferenceFrame: Frame
where
Self: ?Sized,
{
fn origin(&self) -> &TopologySegment;
fn mutate_frame_type(&self) -> FrameType { FrameType::Reference }
fn frame_cast<GLASS>(
self,
observation: crate::daemonic::observation::Observation<GLASS>,
) -> Option<crate::daemonic::observation::Observation<GLASS>>
where
GLASS: Clone + Glass<GLASS> + ReferenceFrame,
Self: Sized,
{ None }
}
pub trait PerspectiveFrame: Frame {
fn perspective_basis(&self) -> &str;
fn bias_estimate(&self) -> f64 { 0.5 }
}
pub trait AccessFrame: Frame {
fn authorized_positions(&self) -> &[TopologySegment];
fn can_observe(&self, observer_position: &TopologySegment) -> bool {
todo!("This needs to be fixed, but isnt version 7 blocking so fuck it, added to the list of shit to do")
}
}
pub trait ExecutionFrame: Frame {
fn scope_depth(&self) -> usize;
fn is_active(&self) -> bool;
fn parent_frame_id(&self) -> Option<u64>;
}
use alloc::vec::Vec;
use core::intrinsics::unreachable;
use crate::daemonic::{AnchorDomainSet, TopologyAnchor, TopologySegment};
use crate::Severity;
use crate::Glass;
use crate::Observation;
use crate::daemonic::{Anchor, SpatialAnchor};