[−][src]Struct mycelium_lib::prelude::Command
Command struct can be used to build a command with the normal builder pattern.
use crate::mycelium_command::prelude::*; let cmd = Command::new() .with_action(Action::Select) .with_what(What::Index(String::from("dog"))) //and .with_or_what(What::Index("idx3".to_string())) //or .with_limit(Limits::First(4)); // first usize results
- Action: Default (error), Archive, Insert, Select, Update. Action to perform.
- Limits: None, Some(Default), Some(First(usize)), Some(Last(usize)), Some(Limit(usize))
- LogicOps: List of logic ops and target
- Tag: Tag to execute command against. Required.
- What: What to execute command or operation against. Id of another node, Index value, or other tags.
Fields
action: Action
limit: Option<Limits>
ops: Vec<(LogicOp, What)>
tag: String
what: What
Methods
impl Command
[src]
pub fn new() -> Command
[src]
pub fn parse(cmd: &str) -> Result<Command, Box<dyn Error + 'static>>
[src]
Parse
Parse a msql statement to a command.
use crate::mycelium_command::prelude::*; let cmd = Command::parse("select from tag").unwrap();
- Parameters
- cmd: msql statement see sql like
pub fn with_action(self, action: Action) -> Command
[src]
pub fn with_limit(self, limit: Limits) -> Command
[src]
pub fn with_what(self, what: What) -> Command
[src]
pub fn with_and_what(self, what: What) -> Command
[src]
pub fn with_or_what(self, what: What) -> Command
[src]
pub fn with_tag(self, tag: &str) -> Command
[src]
Trait Implementations
impl Clone for Command
[src]
impl Debug for Command
[src]
impl Serialize for Command
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl<'de> Deserialize<'de> for Command
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Command, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Command, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl PartialEq<Command> for Command
[src]
impl Default for Command
[src]
Auto Trait Implementations
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
impl RefUnwindSafe for Command
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,