pub struct Federation {
pub id: Uuid,
pub name: String,
pub description: String,
pub org_id: Uuid,
pub services: Vec<ServiceBoundary>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Federation metadata (stored in database)
Fields§
§id: UuidFederation ID
name: StringFederation name
description: StringFederation description
org_id: UuidOrganization ID
services: Vec<ServiceBoundary>Service boundaries
created_at: DateTime<Utc>Created timestamp
updated_at: DateTime<Utc>Updated timestamp
Implementations§
Source§impl Federation
impl Federation
Sourcepub fn from_config(
org_id: Uuid,
config: FederationConfig,
) -> Result<Self, String>
pub fn from_config( org_id: Uuid, config: FederationConfig, ) -> Result<Self, String>
Create a new federation from config
Sourcepub fn find_service_by_path(&self, path: &str) -> Option<&ServiceBoundary>
pub fn find_service_by_path(&self, path: &str) -> Option<&ServiceBoundary>
Find service by path
Sourcepub fn get_service(&self, name: &str) -> Option<&ServiceBoundary>
pub fn get_service(&self, name: &str) -> Option<&ServiceBoundary>
Get service by name
Sourcepub fn add_service(&mut self, service: ServiceBoundary)
pub fn add_service(&mut self, service: ServiceBoundary)
Add a service to the federation
Sourcepub fn remove_service(&mut self, name: &str) -> bool
pub fn remove_service(&mut self, name: &str) -> bool
Remove a service from the federation
Trait Implementations§
Source§impl Clone for Federation
impl Clone for Federation
Source§fn clone(&self) -> Federation
fn clone(&self) -> Federation
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 Federation
impl Debug for Federation
Source§impl<'de> Deserialize<'de> for Federation
impl<'de> Deserialize<'de> for Federation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Federation
impl RefUnwindSafe for Federation
impl Send for Federation
impl Sync for Federation
impl Unpin for Federation
impl UnsafeUnpin for Federation
impl UnwindSafe for Federation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more