Skip to main content

SparqlMmHandler

Struct SparqlMmHandler 

Source
pub struct SparqlMmHandler<'a> {
    pub quins: &'a [NQuin],
    pub windows: [TimeWindow; 64],
    pub window_count: u8,
    pub media_fragments: [MediaFragment; 128],
    pub fragment_count: u8,
}
Expand description

SPARQL-MM Media Handler

Fields§

§quins: &'a [NQuin]§windows: [TimeWindow; 64]§window_count: u8§media_fragments: [MediaFragment; 128]§fragment_count: u8

Implementations§

Source§

impl<'a> SparqlMmHandler<'a>

Source

pub fn new(quins: &'a [NQuin]) -> Self

Source

pub fn make_media_fragment( media_uri: u64, dimensions: &[MediaFragmentDimension], ) -> Result<MediaFragment, String>

Build a media fragment from explicit dimensions (no hash-derived pseudo-parse).

Callers that only have a media URI hash must pass dimensions separately — inventing temporal/spatial ranges from hash bits is forbidden (design §6.3.6).

Source

pub fn parse_media_fragment( &mut self, fragment_uri: u64, ) -> Result<MediaFragment, String>

Legacy entry: returns a fragment with media_uri only (no invented dimensions). Prefer make_media_fragment with explicit temporal/spatial/track dims.

Source

pub fn pack_spatial_u64(x: u32, y: u32, width: u32, height: u32) -> u64

Pack xywh into a single object payload (same layout as vision pack_bbox family).

Source

pub fn unpack_spatial_u64(v: u64) -> (u32, u32, u32, u32)

Source

pub fn spatial_intersects( ax: u32, ay: u32, aw: u32, ah: u32, bx: u32, by: u32, bw: u32, bh: u32, ) -> bool

Axis-aligned box intersection (x,y,w,h).

Source

pub fn media_time_ms(quin: &NQuin) -> Option<u64>

Media time from a quin that uses ma_ont::MEDIA_TIME_MS (object = ms), not the Lamport field in metadata.

Source

pub fn get_ma_property( &self, media_uri: u64, predicate: u64, ) -> Result<u64, String>

Get MA Ontology property for a media resource

Source

pub fn get_temporal_fragment( &self, media_uri: u64, ) -> Result<(u64, u64), String>

Get temporal fragment using MA Ontology

Source

pub fn get_spatial_fragment( &self, media_uri: u64, ) -> Result<(u32, u32, u32, u32), String>

Get spatial fragment using MA Ontology

Source

pub fn get_track_fragment(&self, media_uri: u64) -> Result<(u64, u32), String>

Get track fragment using MA Ontology

Source

pub fn add_media_fragment( &mut self, fragment: MediaFragment, ) -> Result<u8, String>

Add a media fragment

Source

pub fn create_tumbling_window( &mut self, size_ms: u64, start_ms: u64, ) -> Result<u8, String>

Create a tumbling time window

Source

pub fn create_sliding_window( &mut self, size_ms: u64, slide_ms: u64, start_ms: u64, ) -> Result<u8, String>

Create a sliding time window

Source

pub fn create_session_window( &mut self, gap_ms: u64, start_ms: u64, ) -> Result<u8, String>

Create a session window

Source

pub fn query_window( &self, window_id: u8, _timestamp_field: u64, ) -> Result<Vec<&NQuin>, String>

Query quins within a time window (heap-compatible wrapper). Prefer query_window_into on hot paths.

Source

pub fn query_window_into( &'a self, window_id: u8, out: &mut [Option<&'a NQuin>], ) -> Result<usize, String>

Caller-buffered window query. Uses media time when predicate == MEDIA_TIME_MS; otherwise falls back to metadata low 29 bits with the understanding that that path is Lamport-mixed (not pure media time).

Source

pub fn query_media_fragment( &self, fragment_id: u8, ) -> Result<Vec<&NQuin>, String>

Query media fragment (heap wrapper). Prefer query_media_fragment_into.

Source

pub fn query_media_fragment_into( &'a self, fragment_id: u8, out: &mut [Option<&'a NQuin>], ) -> Result<usize, String>

Caller-buffered media-fragment query with real spatial intersection.

Source

pub fn get_media_duration(&self, media_uri: u64) -> Result<u64, String>

Get media duration using MA Ontology

Source

pub fn get_media_dimensions(&self, media_uri: u64) -> Result<(u32, u32), String>

Get media dimensions using MA Ontology

Source

pub fn get_media_format(&self, media_uri: u64) -> Result<u64, String>

Get media format using MA Ontology

Source

pub fn get_media_mime_type(&self, media_uri: u64) -> Result<u64, String>

Get media MIME type using MA Ontology

Source

pub fn get_media_codec(&self, media_uri: u64) -> Result<u64, String>

Get media codec using MA Ontology

Source

pub fn get_media_bitrate(&self, media_uri: u64) -> Result<u64, String>

Get media bitrate using MA Ontology

Source

pub fn get_media_framerate(&self, media_uri: u64) -> Result<u64, String>

Get media framerate using MA Ontology

Source

pub fn get_credential(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get content credential for media

Source

pub fn get_manifest(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get manifest for media

Source

pub fn get_signature(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get signature for media

Source

pub fn get_provenance(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get provenance for media

Source

pub fn is_verified(&self, media_uri: u64) -> Result<bool, String>

C2PA: Check if media is cryptographically verified.

Honest policy: a stored isVerified=1 edge is not sufficient. Returns Ok(true) only when status is SignatureVerified or TrustChainEvaluated. Today this engine never reaches those levels → typically Ok(false) or Err.

Source

pub fn c2pa_status( &self, media_uri: u64, ) -> Result<C2paVerificationStatus, String>

Honest verification ladder for C2PA (design §6.3.7).

Source

pub fn get_verification_status(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get verification status as u64 enum discriminant.

Source

pub fn get_created_at(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get creation timestamp

Source

pub fn get_created_by(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get creator

Source

pub fn get_modified_at(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get modification timestamp

Source

pub fn get_modified_by(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get modifier

Source

pub fn get_tool(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get tool used to create media

Source

pub fn get_derived_from(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get source asset (derived from)

Source

pub fn get_component_of(&self, media_uri: u64) -> Result<u64, String>

C2PA: Get parent asset (component of)

Source

pub fn get_components(&self, media_uri: u64) -> Result<Vec<u64>, String>

C2PA: Get component assets

Source

pub fn verify_signature(&self, media_uri: u64) -> Result<bool, String>

C2PA: Verify content signature. Unsupported in this build — always returns Ok(false) if a signature edge exists (ParsedOnly), or Err if missing. Never claims crypto success.

Source

pub fn window_aggregate( &self, window_id: u8, aggregate_fn: fn(&[&NQuin]) -> u64, ) -> Result<u64, String>

Aggregate over time window

Trait Implementations§

Source§

impl<'a> Default for SparqlMmHandler<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for SparqlMmHandler<'a>

§

impl<'a> RefUnwindSafe for SparqlMmHandler<'a>

§

impl<'a> Send for SparqlMmHandler<'a>

§

impl<'a> Sync for SparqlMmHandler<'a>

§

impl<'a> Unpin for SparqlMmHandler<'a>

§

impl<'a> UnsafeUnpin for SparqlMmHandler<'a>

§

impl<'a> UnwindSafe for SparqlMmHandler<'a>

Blanket Implementations§

§

impl<S, A> Aggregate<Result<S, Error>> for A
where A: Aggregate<S>,

§

fn from_shares<T>(iter: T) -> Result<A, Error>
where T: IntoIterator<Item = Result<S, Error>>,

Aggregate shares in an MPC protocol.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,