[][src]Struct mycelium_command::Command

pub struct Command {
    pub action: Action,
    pub limit: Option<Limits>,
    pub ops: Vec<(LogicOp, What)>,
    pub tag: String,
    pub what: What,
}

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: Actionlimit: Option<Limits>ops: Vec<(LogicOp, What)>tag: Stringwhat: What

Methods

impl Command[src]

pub fn new() -> Command[src]

pub fn parse(cmd: &str) -> Result<Command, Box<dyn Error>>[src]

Parse

Parse a msql statement to a command.

use crate::mycelium_command::prelude::*;
let cmd = Command::parse("select from tag").unwrap();
  • Parameters

pub fn with_action(self, action: Action) -> Self[src]

pub fn with_limit(self, limit: Limits) -> Self[src]

pub fn with_what(self, what: What) -> Self[src]

pub fn with_and_what(self, what: What) -> Self[src]

pub fn with_or_what(self, what: What) -> Self[src]

pub fn with_tag(self, tag: &str) -> Self[src]

Trait Implementations

impl Clone for Command[src]

impl Default for Command[src]

impl PartialEq<Command> for Command[src]

impl Debug for Command[src]

impl Serialize for Command[src]

impl<'de> Deserialize<'de> 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]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]