pub enum GenericLinksOperation<T> {
Count(Vec<Part<T>>),
Each(Vec<Part<T>>),
Create {
source: T,
target: T,
},
Update {
index: T,
source: T,
target: T,
},
Delete(T),
GetName(T),
SetName(T, String),
GetByName(String),
RemoveName(T),
Subscribe(Vec<Part<T>>),
Unsubscribe(T),
}Expand description
One call of the links interface.
Variants§
Count(Vec<Part<T>>)
Number of links matching the restriction.
Each(Vec<Part<T>>)
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(T)
Deletes a link, and every link that still refers to it.
GetName(T)
The name of a link.
SetName(T, String)
Names a link.
GetByName(String)
The link with a name.
RemoveName(T)
Removes the name of a link.
Subscribe(Vec<Part<T>>)
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(T)
Stops a subscription of this connection; the reply is empty, even for an unknown number.
Implementations§
Source§impl<T: QueryAddress> GenericLinksOperation<T>
impl<T: QueryAddress> GenericLinksOperation<T>
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<T> + ?Sized>(
&self,
storage: &mut S,
) -> Result<LinoDocument>
pub fn execute<S: NamedTypeLinks<T> + ?Sized>( &self, storage: &mut S, ) -> Result<LinoDocument>
Runs the operation against storage and returns the reply document.