pub struct DivoomServiceClient { /* private fields */ }
Expand description

Divoom backend service client

This is the client that talks to Divoom online service for fetching information like device info in the same LAN etc.

It is very simple to start using it, simply creates the client without argument, and then start calling the APIs:

use divoom::*;
let divoom = DivoomServiceClient::new();
// let devices = divoom.get_same_lan_devices().await?;
// devices.iter().for_each(|x| println!("{:?}", x));

Implementations

Create new DivoomServiceClient

Create new DivoomServiceClient with options

Create new DivoomServiceClient with specific server URL

Get the server url we send request to

Find device

Official doc: http://doc.divoom-gz.com/web/#/12?page_id=336

Sample response:

{
    "ReturnCode": 0,
    "ReturnMessage": "",
    "DeviceList": [
        {
            "DeviceName": "Pixoo64",
            "DeviceId": 300000020,
            "DevicePrivateIP": "10.0.0.100"
        },
        ...
    ]
}
Get channel type

Official doc: http://doc.divoom-gz.com/web/#/12?page_id=189

Sample response:

{
    "ReturnCode": 0,
    "ReturnMessage": "",
    "DialTypeList": [
        "Social",
        "normal",
        "financial",
        "Game",
        "HOLIDAYS",
        "TOOLS",
        "DESIGN-64"
    ]
}
Get clock list

Official doc: http://doc.divoom-gz.com/web/#/12?page_id=190

Sample request:

{
    "DialType":"Social",
    "Page":1
}

Sample response:

{
    "ReturnCode": 0,
    "ReturnMessage": "",
    "TotalNum": 100,
    "DialList": [
        {
            "ClockId": 10,
            "Name": "Classic Digital Clock"
        },
        ...
    ]
}
Get time channel font list.

Official doc: http://doc.divoom-gz.com/web/#/12?page_id=233

Sample response:

{
    "ReturnCode": 0,
    "ReturnMessage": "",
    "FontList": [
        {
            "id": 2,
            "name": "8*8 English letters, Arabic figures,punctuation",
            "width": "8",
            "high": "8",
            "charset": "",
            "type": 0
        },
        ...
    ]
}

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more