pub struct DatabaseId(/* private fields */);Expand description
The ID of this Ditto database, used to determine which peers to sync with
Implementations§
Source§impl DatabaseId
impl DatabaseId
Sourcepub fn from_env(var: &str) -> Result<Self, DittoError>
pub fn from_env(var: &str) -> Result<Self, DittoError>
Attempt to grab a specific DatabaseId from some environment variable
Sourcepub fn to_c_string(&self) -> Box
pub fn to_c_string(&self) -> Box
Return the corresponding c string
Sourcepub fn default_auth_url(&self) -> String
pub fn default_auth_url(&self) -> String
Return the default auth URL associated with the database ID. This is of the form
https://{database_id}.cloud.ditto.live/ by default.
Sourcepub fn default_sync_url(&self) -> String
pub fn default_sync_url(&self) -> String
Return the default WebSocket sync URL which is of the form
wss://{database_id}.cloud.ditto.live/ by default.
Trait Implementations§
Source§impl Clone for DatabaseId
impl Clone for DatabaseId
Source§fn clone(&self) -> DatabaseId
fn clone(&self) -> DatabaseId
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 DatabaseId
impl Debug for DatabaseId
Source§impl Display for DatabaseId
impl Display for DatabaseId
Source§impl FromStr for DatabaseId
impl FromStr for DatabaseId
Source§type Err = DittoError
type Err = DittoError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<DatabaseId, DittoError>
fn from_str(s: &str) -> Result<DatabaseId, DittoError>
Parses a string
s to return a value of this type. Read moreAuto Trait Implementations§
impl Freeze for DatabaseId
impl RefUnwindSafe for DatabaseId
impl Send for DatabaseId
impl Sync for DatabaseId
impl Unpin for DatabaseId
impl UnwindSafe for DatabaseId
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