pub enum LinksOperation {
Count(Vec<Part>),
Each(Vec<Part>),
Create {
source: u32,
target: u32,
},
Update {
index: u32,
source: u32,
target: u32,
},
Delete(u32),
GetName(u32),
SetName(u32, String),
GetByName(String),
RemoveName(u32),
}Expand description
One call of the links interface.
Variants§
Count(Vec<Part>)
Number of links matching the restriction.
Each(Vec<Part>)
Every link matching the restriction, ordered by index.
Create
Creates a link.
Update
Points an existing link at a new source and target; an update that would duplicate an existing link merges into it instead.
Delete(u32)
Deletes a link, and every link that still refers to it.
GetName(u32)
The name of a link.
SetName(u32, String)
Names a link.
GetByName(String)
The link with a name.
RemoveName(u32)
Removes the name of a link.
Implementations§
Source§impl LinksOperation
impl LinksOperation
Sourcepub fn to_document(&self) -> LinoDocument
pub fn to_document(&self) -> LinoDocument
The request document for this operation.
Sourcepub fn from_document(document: &[LiNo<String>]) -> ProtocolResult<Option<Self>>
pub fn from_document(document: &[LiNo<String>]) -> ProtocolResult<Option<Self>>
Recognises an operation request; Ok(None) for any other document,
such as a substitution query.
Sourcepub fn execute<S: NamedTypeLinks + ?Sized>(
&self,
storage: &mut S,
) -> Result<LinoDocument>
pub fn execute<S: NamedTypeLinks + ?Sized>( &self, storage: &mut S, ) -> Result<LinoDocument>
Runs the operation against storage and returns the reply document.
Trait Implementations§
Source§impl Clone for LinksOperation
impl Clone for LinksOperation
Source§fn clone(&self) -> LinksOperation
fn clone(&self) -> LinksOperation
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 LinksOperation
impl Debug for LinksOperation
impl Eq for LinksOperation
Source§impl PartialEq for LinksOperation
impl PartialEq for LinksOperation
impl StructuralPartialEq for LinksOperation
Auto Trait Implementations§
impl Freeze for LinksOperation
impl RefUnwindSafe for LinksOperation
impl Send for LinksOperation
impl Sync for LinksOperation
impl Unpin for LinksOperation
impl UnsafeUnpin for LinksOperation
impl UnwindSafe for LinksOperation
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