pub struct InMemoryLinkService { /* private fields */ }Expand description
In-memory link service implementation
Useful for testing and development. Uses RwLock for thread-safe access.
Implementations§
Trait Implementations§
Source§impl Clone for InMemoryLinkService
impl Clone for InMemoryLinkService
Source§fn clone(&self) -> InMemoryLinkService
fn clone(&self) -> InMemoryLinkService
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 Default for InMemoryLinkService
impl Default for InMemoryLinkService
Source§impl LinkService for InMemoryLinkService
impl LinkService for InMemoryLinkService
Source§fn create<'life0, 'async_trait>(
&'life0 self,
link: LinkEntity,
) -> Pin<Box<dyn Future<Output = Result<LinkEntity>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
link: LinkEntity,
) -> Pin<Box<dyn Future<Output = Result<LinkEntity>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new link between two entities
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a specific link by ID
Source§fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all links
Source§fn find_by_source<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 Uuid,
link_type: Option<&'life2 str>,
target_type: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn find_by_source<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 Uuid,
link_type: Option<&'life2 str>,
target_type: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Find links by source entity Read more
Source§fn find_by_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
target_id: &'life1 Uuid,
link_type: Option<&'life2 str>,
source_type: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn find_by_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
target_id: &'life1 Uuid,
link_type: Option<&'life2 str>,
source_type: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LinkEntity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Find links by target entity Read more
Source§fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
updated_link: LinkEntity,
) -> Pin<Box<dyn Future<Output = Result<LinkEntity>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
updated_link: LinkEntity,
) -> Pin<Box<dyn Future<Output = Result<LinkEntity>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a link’s metadata Read more
Auto Trait Implementations§
impl Freeze for InMemoryLinkService
impl RefUnwindSafe for InMemoryLinkService
impl Send for InMemoryLinkService
impl Sync for InMemoryLinkService
impl Unpin for InMemoryLinkService
impl UnwindSafe for InMemoryLinkService
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