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: u8Implementations§
Source§impl<'a> SparqlMmHandler<'a>
impl<'a> SparqlMmHandler<'a>
pub fn new(quins: &'a [NQuin]) -> Self
Sourcepub fn make_media_fragment(
media_uri: u64,
dimensions: &[MediaFragmentDimension],
) -> Result<MediaFragment, String>
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).
Sourcepub fn parse_media_fragment(
&mut self,
fragment_uri: u64,
) -> Result<MediaFragment, String>
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.
Sourcepub fn pack_spatial_u64(x: u32, y: u32, width: u32, height: u32) -> u64
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).
pub fn unpack_spatial_u64(v: u64) -> (u32, u32, u32, u32)
Sourcepub fn spatial_intersects(
ax: u32,
ay: u32,
aw: u32,
ah: u32,
bx: u32,
by: u32,
bw: u32,
bh: u32,
) -> bool
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).
Sourcepub fn media_time_ms(quin: &NQuin) -> Option<u64>
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.
Sourcepub fn get_ma_property(
&self,
media_uri: u64,
predicate: u64,
) -> Result<u64, String>
pub fn get_ma_property( &self, media_uri: u64, predicate: u64, ) -> Result<u64, String>
Get MA Ontology property for a media resource
Sourcepub fn get_temporal_fragment(
&self,
media_uri: u64,
) -> Result<(u64, u64), String>
pub fn get_temporal_fragment( &self, media_uri: u64, ) -> Result<(u64, u64), String>
Get temporal fragment using MA Ontology
Sourcepub fn get_spatial_fragment(
&self,
media_uri: u64,
) -> Result<(u32, u32, u32, u32), String>
pub fn get_spatial_fragment( &self, media_uri: u64, ) -> Result<(u32, u32, u32, u32), String>
Get spatial fragment using MA Ontology
Sourcepub fn get_track_fragment(&self, media_uri: u64) -> Result<(u64, u32), String>
pub fn get_track_fragment(&self, media_uri: u64) -> Result<(u64, u32), String>
Get track fragment using MA Ontology
Sourcepub fn add_media_fragment(
&mut self,
fragment: MediaFragment,
) -> Result<u8, String>
pub fn add_media_fragment( &mut self, fragment: MediaFragment, ) -> Result<u8, String>
Add a media fragment
Sourcepub fn create_tumbling_window(
&mut self,
size_ms: u64,
start_ms: u64,
) -> Result<u8, String>
pub fn create_tumbling_window( &mut self, size_ms: u64, start_ms: u64, ) -> Result<u8, String>
Create a tumbling time window
Sourcepub fn create_sliding_window(
&mut self,
size_ms: u64,
slide_ms: u64,
start_ms: u64,
) -> Result<u8, String>
pub fn create_sliding_window( &mut self, size_ms: u64, slide_ms: u64, start_ms: u64, ) -> Result<u8, String>
Create a sliding time window
Sourcepub fn create_session_window(
&mut self,
gap_ms: u64,
start_ms: u64,
) -> Result<u8, String>
pub fn create_session_window( &mut self, gap_ms: u64, start_ms: u64, ) -> Result<u8, String>
Create a session window
Sourcepub fn query_window(
&self,
window_id: u8,
_timestamp_field: u64,
) -> Result<Vec<&NQuin>, String>
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.
Sourcepub fn query_window_into(
&'a self,
window_id: u8,
out: &mut [Option<&'a NQuin>],
) -> Result<usize, String>
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).
Sourcepub fn query_media_fragment(
&self,
fragment_id: u8,
) -> Result<Vec<&NQuin>, String>
pub fn query_media_fragment( &self, fragment_id: u8, ) -> Result<Vec<&NQuin>, String>
Query media fragment (heap wrapper). Prefer query_media_fragment_into.
Sourcepub fn query_media_fragment_into(
&'a self,
fragment_id: u8,
out: &mut [Option<&'a NQuin>],
) -> Result<usize, String>
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.
Sourcepub fn get_media_duration(&self, media_uri: u64) -> Result<u64, String>
pub fn get_media_duration(&self, media_uri: u64) -> Result<u64, String>
Get media duration using MA Ontology
Sourcepub fn get_media_dimensions(&self, media_uri: u64) -> Result<(u32, u32), String>
pub fn get_media_dimensions(&self, media_uri: u64) -> Result<(u32, u32), String>
Get media dimensions using MA Ontology
Sourcepub fn get_media_format(&self, media_uri: u64) -> Result<u64, String>
pub fn get_media_format(&self, media_uri: u64) -> Result<u64, String>
Get media format using MA Ontology
Sourcepub fn get_media_mime_type(&self, media_uri: u64) -> Result<u64, String>
pub fn get_media_mime_type(&self, media_uri: u64) -> Result<u64, String>
Get media MIME type using MA Ontology
Sourcepub fn get_media_codec(&self, media_uri: u64) -> Result<u64, String>
pub fn get_media_codec(&self, media_uri: u64) -> Result<u64, String>
Get media codec using MA Ontology
Sourcepub fn get_media_bitrate(&self, media_uri: u64) -> Result<u64, String>
pub fn get_media_bitrate(&self, media_uri: u64) -> Result<u64, String>
Get media bitrate using MA Ontology
Sourcepub fn get_media_framerate(&self, media_uri: u64) -> Result<u64, String>
pub fn get_media_framerate(&self, media_uri: u64) -> Result<u64, String>
Get media framerate using MA Ontology
Sourcepub fn get_credential(&self, media_uri: u64) -> Result<u64, String>
pub fn get_credential(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get content credential for media
Sourcepub fn get_signature(&self, media_uri: u64) -> Result<u64, String>
pub fn get_signature(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get signature for media
Sourcepub fn get_provenance(&self, media_uri: u64) -> Result<u64, String>
pub fn get_provenance(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get provenance for media
Sourcepub fn is_verified(&self, media_uri: u64) -> Result<bool, String>
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.
Sourcepub fn c2pa_status(
&self,
media_uri: u64,
) -> Result<C2paVerificationStatus, String>
pub fn c2pa_status( &self, media_uri: u64, ) -> Result<C2paVerificationStatus, String>
Honest verification ladder for C2PA (design §6.3.7).
Sourcepub fn get_verification_status(&self, media_uri: u64) -> Result<u64, String>
pub fn get_verification_status(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get verification status as u64 enum discriminant.
Sourcepub fn get_created_at(&self, media_uri: u64) -> Result<u64, String>
pub fn get_created_at(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get creation timestamp
Sourcepub fn get_modified_at(&self, media_uri: u64) -> Result<u64, String>
pub fn get_modified_at(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get modification timestamp
Sourcepub fn get_tool(&self, media_uri: u64) -> Result<u64, String>
pub fn get_tool(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get tool used to create media
Sourcepub fn get_derived_from(&self, media_uri: u64) -> Result<u64, String>
pub fn get_derived_from(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get source asset (derived from)
Sourcepub fn get_component_of(&self, media_uri: u64) -> Result<u64, String>
pub fn get_component_of(&self, media_uri: u64) -> Result<u64, String>
C2PA: Get parent asset (component of)
Sourcepub fn get_components(&self, media_uri: u64) -> Result<Vec<u64>, String>
pub fn get_components(&self, media_uri: u64) -> Result<Vec<u64>, String>
C2PA: Get component assets
Trait Implementations§
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 Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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