Fixed instance lifetime parameter

This commit is contained in:
kozabrada123 2023-05-05 22:46:00 +02:00
parent bc3e93ce5a
commit 8414bbb1c2
4 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ pub mod login {
use crate::errors::InstanceServerError;
use crate::instance::Instance;
impl Instance<'_> {
impl<'a> Instance<'a> {
pub async fn login_account(
&mut self,
login_schema: &LoginSchema,

View File

@ -8,7 +8,7 @@ pub mod register {
instance::{Instance, Token},
};
impl Instance<'_> {
impl<'a> Instance<'a> {
/**
Registers a new user on the Spacebar server.
# Arguments

View File

@ -5,7 +5,7 @@ pub mod instance {
use crate::errors::InstanceServerError;
use crate::{api::types::InstancePolicies, instance::Instance};
impl Instance<'_> {
impl<'a> Instance<'a> {
/**
Gets the instance policies schema.
# Errors

View File

@ -20,7 +20,7 @@ pub struct Instance<'a> {
pub users: HashMap<Token, User>,
}
impl Instance<'_> {
impl<'a> Instance<'a> {
/// Creates a new [`Instance`].
/// # Arguments
/// * `urls` - The [`URLBundle`] that contains all the URLs that are needed to connect to the Spacebar server.
@ -30,7 +30,7 @@ impl Instance<'_> {
pub async fn new(
urls: URLBundle,
requester: LimitedRequester,
) -> Result<Instance<'static>, InstanceServerError> {
) -> Result<Instance<'a>, InstanceServerError> {
let users: HashMap<Token, User> = HashMap::new();
let mut instance = Instance {
urls: urls.clone(),