pub struct ShipInterface {
pub url: String,
pub session_auth: HeaderValue,
pub ship_name: String,
/* private fields */
}
Fields§
§url: String
The URL of the ship given as http://ip:port
such as
http://0.0.0.0:8080
.
session_auth: HeaderValue
The session auth string header value
ship_name: String
The ship name (without a leading ~)
Implementations§
Source§impl ShipInterface
impl ShipInterface
Sourcepub fn new(ship_url: &str, ship_code: &str) -> Result<ShipInterface>
pub fn new(ship_url: &str, ship_code: &str) -> Result<ShipInterface>
Logs into the given ship and creates a new ShipInterface
.
ship_url
should be http://ip:port
of the given ship. Example:
http://0.0.0.0:8080
. ship_code
is the code acquire from your ship
by typing +code
in dojo.
Sourcepub fn ship_name_with_sig(&self) -> String
pub fn ship_name_with_sig(&self) -> String
Returns the ship name with a leading ~
(By default ship_name does not have one)
Sourcepub fn create_channel(&self) -> Result<Channel>
pub fn create_channel(&self) -> Result<Channel>
Create a Channel
using this ShipInterface
pub fn send_put_request(&self, url: &str, body: &JsonValue) -> Result<Response>
Trait Implementations§
Source§impl Clone for ShipInterface
impl Clone for ShipInterface
Source§fn clone(&self) -> ShipInterface
fn clone(&self) -> ShipInterface
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ShipInterface
impl Debug for ShipInterface
Auto Trait Implementations§
impl !Freeze for ShipInterface
impl !RefUnwindSafe for ShipInterface
impl Send for ShipInterface
impl Sync for ShipInterface
impl Unpin for ShipInterface
impl !UnwindSafe for ShipInterface
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