pub struct Transaction {
pub id: Option<String>,
pub label: Option<String>,
pub changes: Vec<SemanticChange>,
}Expand description
Ordered semantic edits applied as one atomic unit.
Fields§
§id: Option<String>§label: Option<String>§changes: Vec<SemanticChange>Implementations§
Source§impl Transaction
impl Transaction
pub fn new(changes: Vec<SemanticChange>) -> Self
pub fn from_turtle(changes: Vec<PatchOp>) -> Self
pub fn from_obo(changes: Vec<OboPatchOp>) -> Self
pub fn is_empty(&self) -> bool
pub fn format(&self) -> Result<EditFormat>
pub fn compose(self, other: Transaction) -> Result<Self>
pub fn invert(&self) -> Result<Self>
pub fn validate(&self) -> Result<()>
pub fn apply_to_text( &self, source: &str, preview_only: bool, namespaces: &BTreeMap<String, String>, ) -> Result<ApplyTextResult>
Sourcepub fn apply_to_text_as(
&self,
source: &str,
preview_only: bool,
namespaces: &BTreeMap<String, String>,
format: EditFormat,
) -> Result<ApplyTextResult>
pub fn apply_to_text_as( &self, source: &str, preview_only: bool, namespaces: &BTreeMap<String, String>, format: EditFormat, ) -> Result<ApplyTextResult>
Apply with an explicit document format (RDF/XML / OWL/XML use Horned re-serialize).
pub fn turtle_patches(&self) -> Result<Vec<PatchOp>>
pub fn obo_patches(&self) -> Result<Vec<OboPatchOp>>
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl Default for Transaction
impl Default for Transaction
Source§fn default() -> Transaction
fn default() -> Transaction
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Transaction
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§impl Serialize for Transaction
impl Serialize for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.