Progress on syncblock macro

This commit is contained in:
2026-03-19 21:53:07 +01:00
parent 2baee8d28b
commit 6e2283755a
5 changed files with 527 additions and 58 deletions

View File

@ -1,9 +1,9 @@
use std::{
any::Any,
collections::HashMap,
ops::{Deref, DerefMut},
sync::{Arc, Mutex},
};
use std::any::Any;
use std::collections::HashMap;
use std::ops::Deref;
use std::ops::DerefMut;
use std::sync::Arc;
use std::sync::Mutex;
// Tags a particular sample within a specific stream
#[derive(Clone)]
@ -20,6 +20,19 @@ pub struct Tag
pub data: Arc<Mutex<HashMap<String, Arc<dyn Any + Send + Sync>>>>,
}
impl Tag
{
pub fn merge_tag_opts<const N: usize>(tag_opts: [Option<Tag>; N]) -> Option<Tag>
{
let mut out_tag = None;
for tag in tag_opts.iter()
{
out_tag = out_tag.merge(tag);
}
out_tag
}
}
pub trait TagValue: Clone {}
impl<T> TagValue for T where T: Clone {}