use std::sync::Arc;
use uuid::Uuid;
use super::DepNode;
use crate::{signal::Signal, subscription::SubscriptionGuard};
pub trait Gettable<T> {
fn get(&self) -> T;
}
pub trait Watchable<T>: Clone + Gettable<T> + DepNode + Sized + Send + Sync + 'static {
fn subscribe(&self, callback: impl Fn(&Signal<T>) + Send + Sync + 'static)
-> SubscriptionGuard;
fn unsubscribe(&self, id: Uuid);
fn is_complete(&self) -> bool;
fn is_error(&self) -> bool;
fn error(&self) -> Option<Arc<anyhow::Error>>;
}