Progress on syncblock macro
This commit is contained in:
@ -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 {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user