Lift 'static restriction on connect methods (#1926)
This commit is contained in:
parent
107e5b5dba
commit
fb6f1caa6b
5 changed files with 5 additions and 8 deletions
lib/src/api
|
@ -256,7 +256,7 @@ impl Surreal<Any> {
|
|||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
pub fn connect(&'static self, address: impl IntoEndpoint) -> Connect<Any, ()> {
|
||||
pub fn connect(&self, address: impl IntoEndpoint) -> Connect<Any, ()> {
|
||||
Connect {
|
||||
router: Some(&self.router),
|
||||
address: address.into_endpoint(),
|
||||
|
|
|
@ -312,10 +312,7 @@ pub struct Db {
|
|||
|
||||
impl Surreal<Db> {
|
||||
/// Connects to a specific database endpoint, saving the connection on the static client
|
||||
pub fn connect<P>(
|
||||
&'static self,
|
||||
address: impl IntoEndpoint<P, Client = Db>,
|
||||
) -> Connect<Db, ()> {
|
||||
pub fn connect<P>(&self, address: impl IntoEndpoint<P, Client = Db>) -> Connect<Db, ()> {
|
||||
Connect {
|
||||
router: Some(&self.router),
|
||||
address: address.into_endpoint(),
|
||||
|
|
|
@ -89,7 +89,7 @@ impl Surreal<Client> {
|
|||
/// # }
|
||||
/// ```
|
||||
pub fn connect<P>(
|
||||
&'static self,
|
||||
&self,
|
||||
address: impl IntoEndpoint<P, Client = Client>,
|
||||
) -> Connect<Client, ()> {
|
||||
Connect {
|
||||
|
|
|
@ -72,7 +72,7 @@ impl Surreal<Client> {
|
|||
/// # }
|
||||
/// ```
|
||||
pub fn connect<P>(
|
||||
&'static self,
|
||||
&self,
|
||||
address: impl IntoEndpoint<P, Client = Client>,
|
||||
) -> Connect<Client, ()> {
|
||||
Connect {
|
||||
|
|
|
@ -44,7 +44,7 @@ pub struct Client {
|
|||
|
||||
impl Surreal<Client> {
|
||||
pub fn connect<P>(
|
||||
&'static self,
|
||||
&self,
|
||||
address: impl IntoEndpoint<P, Client = Client>,
|
||||
) -> Connect<Client, ()> {
|
||||
Connect {
|
||||
|
|
Loading…
Reference in a new issue