pub struct Server {
    pub base_url: String,
    pub owner: String,
    pub id: String,
    /* private fields */
}
Expand description

A single catalyst server.

Fields

base_url: Stringowner: Stringid: String

Implementations

Constructs a new Server using a custom base_url.

Example
let server = catalyst::Server::new("https://my-awesome-server.org");
assert_eq!(server.base_url, "https://my-awesome-server.org")

Constructs a new Server using a development base_url (https://server.decentraland.zone).

Example
let server = catalyst::Server::development();
assert_eq!(server.base_url, "https://peer.decentraland.zone")

Constructs a new Server using a staging base_url (https://peer-testing.decentraland.org).

Example
let server = catalyst::Server::staging();
assert_eq!(server.base_url,"https://peer-testing.decentraland.org")

Constructs a new Server using a production root base_url (https://peer.decentraland.org).

Example
let server = catalyst::Server::production();
assert_eq!(server.base_url, "https://peer.decentraland.org")

Executes a GET request to path. The response is parsed as JSON and deserialized in the result. If you need to deal with the result by hand, use get_raw.

Executes a GET request to path. The response is returned as is using reqwest::Response. For automatic deserialization of JSON response see get.

Executes a POST request to path with body body. The response is parsed as JSON and deserialized in the result. If you need to deal with the result by hand, use get_raw.

source

pub async fn raw_post<U, B>(&self, path: U, body: &B) -> Result<Response> where
    U: AsRef<str> + Display,
    B: for<'a> Serialize

Executes a POST request to path with body body. The response is returned as is using reqwest::Response. For automatic deserialization of JSON response see post.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. 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 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