pub enum MoonMSG {
Show 15 variants
MoonResult {
jsonrpc: JsonRpcVersion,
result: MoonResultData,
id: u32,
},
MoonError {
jsonrpc: JsonRpcVersion,
error: MoonErrorContent,
id: u32,
},
MethodParamID {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
params: MoonParam,
id: u32,
},
MethodParamVecID {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
params: Vec<MoonParam>,
id: u32,
},
MethodParamVec {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
params: Vec<MoonParam>,
},
MethodParam {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
params: MoonParam,
},
MethodID {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
id: u32,
},
Method {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
},
CouldNotParseParamsID {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
params: Value,
id: u32,
},
CouldNotParseParams {
jsonrpc: JsonRpcVersion,
method: MoonMethod,
params: Value,
},
CouldNotParseMethodID {
jsonrpc: JsonRpcVersion,
method: String,
params: MoonParam,
id: u32,
},
CouldNotParseMethod {
jsonrpc: JsonRpcVersion,
method: String,
params: MoonParam,
},
CouldNotParseMethodParamsID {
jsonrpc: JsonRpcVersion,
method: String,
params: Value,
id: u32,
},
CouldNotParseMethodParams {
jsonrpc: JsonRpcVersion,
method: String,
params: Value,
},
Empty,
}Variants§
MoonResult
MoonError
MethodParamID
MethodParamVecID
MethodParamVec
MethodParam
MethodID
Method
CouldNotParseParamsID
CouldNotParseParams
CouldNotParseMethodID
CouldNotParseMethod
CouldNotParseMethodParamsID
CouldNotParseMethodParams
Empty
Implementations§
Source§impl MoonMSG
impl MoonMSG
Sourcepub fn new(
method: MoonMethod,
params: Option<MoonParam>,
id: Option<u32>,
) -> MoonMSG
pub fn new( method: MoonMethod, params: Option<MoonParam>, id: Option<u32>, ) -> MoonMSG
Creates a new MoonMSG which can be sent to Moonraker via the websocket The method is the name of the method to be called and is required for all messages The params are the parameters to be passed to the method and are optional for some types of messages refer to the moonraker api docs for more information for now. The id is the id of the message and is optional for some types of messages. It allows you to match up responses to requests. Assuming you use unique ids for every message you send, a response with a match id is the response to the request with that id.
pub fn new_error(error: MoonErrorContent, id: u32) -> MoonMSG
pub fn new_result(result: MoonResultData, id: u32) -> MoonMSG
pub fn gcode(gcode: String, id: u32) -> MoonMSG
pub fn method(&self) -> MoonMethod
pub fn params(&self) -> Vec<MoonParam>
pub fn set_id(&self, id: u32) -> MoonMSG
pub fn id(&self) -> Option<u32>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MoonMSG
impl<'de> Deserialize<'de> for MoonMSG
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for MoonMSG
Auto Trait Implementations§
impl Freeze for MoonMSG
impl RefUnwindSafe for MoonMSG
impl Send for MoonMSG
impl Sync for MoonMSG
impl Unpin for MoonMSG
impl UnwindSafe for MoonMSG
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