pub struct SchemaDiscovery<State = Ready> { /* private fields */ }Expand description
Schema discovery component with state machine design.
The component uses phantom types to encode its configuration state at compile time, preventing invalid operations and ensuring proper initialization sequence. This component is specifically designed for schema discovery and service provider configuration, not for resource CRUD operations.
§Type Parameters
State- The current state of the component (Uninitialized or Ready)
§Example
use scim_server::SchemaDiscovery;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a schema discovery component
let discovery = SchemaDiscovery::new()?;
// Get available schemas
let schemas = discovery.get_schemas().await?;
println!("Available schemas: {}", schemas.len());
// For resource CRUD operations, use ScimServer instead
Ok(())
}Implementations§
Source§impl SchemaDiscovery<Uninitialized>
impl SchemaDiscovery<Uninitialized>
Sourcepub fn new() -> BuildResult<SchemaDiscovery<Ready>>
pub fn new() -> BuildResult<SchemaDiscovery<Ready>>
Create a new schema discovery component.
This creates a component with default configuration and schema registry for schema discovery and service provider configuration. For resource CRUD operations, use ScimServer instead.
Source§impl SchemaDiscovery<Ready>
impl SchemaDiscovery<Ready>
Sourcepub async fn get_schemas(&self) -> ScimResult<Vec<Schema>>
pub async fn get_schemas(&self) -> ScimResult<Vec<Schema>>
Get all available schemas.
Returns the complete list of schemas supported by this component instance. For the MVP, this includes only the core User schema.
Sourcepub async fn get_schema(&self, id: &str) -> ScimResult<Option<Schema>>
pub async fn get_schema(&self, id: &str) -> ScimResult<Option<Schema>>
Sourcepub async fn get_service_provider_config(
&self,
) -> ScimResult<ServiceProviderConfig>
pub async fn get_service_provider_config( &self, ) -> ScimResult<ServiceProviderConfig>
Get the service provider configuration.
Returns the capabilities and configuration of this SCIM service provider as defined in RFC 7644.
Sourcepub fn schema_registry(&self) -> &SchemaRegistry
pub fn schema_registry(&self) -> &SchemaRegistry
Get the schema registry for advanced usage.
This provides access to the underlying schema registry for custom validation or schema introspection.
Sourcepub fn service_config(&self) -> &ServiceProviderConfig
pub fn service_config(&self) -> &ServiceProviderConfig
Get the service provider configuration.