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),
Subscribe(Vec<Part>),
Unsubscribe(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.
Subscribe(Vec<Part>)
Asks a LinksServer to push the changes other
connections make to the links matching the restriction; the reply is
(subscription: N) and every later push a notification_document.
A subscription belongs to the connection that made it: only the server
can run it, so execute on a store fails.
Unsubscribe(u32)
Stops a subscription of this connection; the reply is empty, even for an unknown number.
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.