use libhaystack::val::{Value, kind::HaystackKind};
use uuid::Uuid;
use crate::base::link::{BaseLink, Link};
pub trait InputProps {
type Reader;
type Writer: Clone;
fn name(&self) -> &str;
fn kind(&self) -> &HaystackKind;
fn block_id(&self) -> &Uuid;
fn is_connected(&self) -> bool;
fn links(&self) -> Vec<&(dyn Link + Send)>;
fn has_output(&self) -> bool {
!self.links().is_empty()
}
fn add_link(&mut self, link: BaseLink<Self::Writer>);
fn remove_link(&mut self, link: &dyn Link) {
self.remove_link_by_id(link.id())
}
fn remove_link_by_id(&mut self, link_id: &Uuid);
fn remove_target_block_links(&mut self, block_id: &Uuid);
fn remove_all_links(&mut self);
fn reader(&mut self) -> &mut Self::Reader;
fn writer(&mut self) -> &mut Self::Writer;
fn get_value(&self) -> Option<&Value>;
fn increment_conn(&mut self) -> usize;
fn decrement_conn(&mut self) -> usize;
}