pub struct PostgresResourceBookingRepository { /* private fields */ }Implementations§
Trait Implementations§
Source§impl ResourceBookingRepository for PostgresResourceBookingRepository
impl ResourceBookingRepository for PostgresResourceBookingRepository
Source§fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
booking: &'life1 ResourceBooking,
) -> Pin<Box<dyn Future<Output = Result<ResourceBooking, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
booking: &'life1 ResourceBooking,
) -> Pin<Box<dyn Future<Output = Result<ResourceBooking, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new booking
Source§fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find booking by ID
Source§fn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all bookings for a building
Source§fn find_by_building_and_resource_type<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_building_and_resource_type<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all bookings for a building with a specific resource type
Source§fn find_by_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
resource_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
resource_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find all bookings for a specific resource (building_id, resource_type, resource_name)
Source§fn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find bookings by user (owner who made the booking)
Source§fn find_by_user_and_status<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
status: BookingStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_user_and_status<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
status: BookingStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find bookings by user and status
Source§fn find_by_building_and_status<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: BookingStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_building_and_status<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: BookingStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find bookings by building and status
Source§fn find_upcoming<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_upcoming<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find upcoming bookings (start_time in the future, status Confirmed or Pending)
Source§fn find_active<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_active<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find active bookings (currently in progress: now >= start_time AND now < end_time)
Source§fn find_past<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_past<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find past bookings (end_time < now)
Source§fn find_conflicts<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
resource_name: &'life1 str,
start_time: DateTime<Utc>,
end_time: DateTime<Utc>,
exclude_booking_id: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_conflicts<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
resource_name: &'life1 str,
start_time: DateTime<Utc>,
end_time: DateTime<Utc>,
exclude_booking_id: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceBooking>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find conflicting bookings for a time range and resource Read more
Source§fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
booking: &'life1 ResourceBooking,
) -> Pin<Box<dyn Future<Output = Result<ResourceBooking, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
booking: &'life1 ResourceBooking,
) -> Pin<Box<dyn Future<Output = Result<ResourceBooking, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update booking
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete booking
Source§fn count_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count total bookings for a building
Source§fn count_by_building_and_status<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: BookingStatus,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_by_building_and_status<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: BookingStatus,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count bookings by building and status
Source§fn count_by_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
resource_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_by_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
resource_type: ResourceType,
resource_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count bookings by resource
Auto Trait Implementations§
impl Freeze for PostgresResourceBookingRepository
impl !RefUnwindSafe for PostgresResourceBookingRepository
impl Send for PostgresResourceBookingRepository
impl Sync for PostgresResourceBookingRepository
impl Unpin for PostgresResourceBookingRepository
impl !UnwindSafe for PostgresResourceBookingRepository
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.