Trait sit_core::item::Item
[−]
[src]
pub trait Item: Sized { type Error: Error + Debug; type Record: Record; type Records: IntoIterator<Item = Self::Record>; type RecordIter: Iterator<Item = Self::Records>; fn id(&self) -> &str; fn record_iter(&self) -> Result<Self::RecordIter, Self::Error>; fn new_record<S: AsRef<str>, R: Read, I: Iterator<Item = (S, R)>>(
&self,
iter: I,
link_parents: bool
) -> Result<Self::Record, Self::Error>; }
Because of SIT's extensible nature, item can be used to represent a wild variety of entities, such as issue, documents, accounts, etc.
Associated Types
type Error: Error + Debug
Error type used by the implementation
type Record: Record
Record type used by the implementation
type Records: IntoIterator<Item = Self::Record>
Type used to list records that can be referenced as a slice of records
type RecordIter: Iterator<Item = Self::Records>
Iterator over lists of records
Required Methods
fn id(&self) -> &str
Issue must have an ID, ideally human-readable
fn record_iter(&self) -> Result<Self::RecordIter, Self::Error>
Iterates through the tree of records
fn new_record<S: AsRef<str>, R: Read, I: Iterator<Item = (S, R)>>(
&self,
iter: I,
link_parents: bool
) -> Result<Self::Record, Self::Error>
&self,
iter: I,
link_parents: bool
) -> Result<Self::Record, Self::Error>
Creates and returns a new record.
Will reference all dangling records as its parent, unless
link_parents
is set to false
Implementors
impl<'a> ItemTrait for Item<'a> type Error = Error; type Record = Record<'a>; type Records = Vec<Record<'a>>; type RecordIter = ItemRecordIter<'a>;