pub struct GraphBuilder { /* private fields */ }Expand description
Builder for constructing graph data from various sources
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
Sourcepub fn add_endpoint(
&mut self,
endpoint_id: String,
name: String,
protocol: Protocol,
metadata: HashMap<String, Value>,
)
pub fn add_endpoint( &mut self, endpoint_id: String, name: String, protocol: Protocol, metadata: HashMap<String, Value>, )
Add an endpoint node from UI Builder endpoint configuration
Sourcepub fn add_chain(&mut self, chain: &ChainDefinition)
pub fn add_chain(&mut self, chain: &ChainDefinition)
Add a chain and create edges for dependencies
Sourcepub fn add_state_transition(
&mut self,
from_node_id: String,
to_node_id: String,
transition_label: Option<String>,
)
pub fn add_state_transition( &mut self, from_node_id: String, to_node_id: String, transition_label: Option<String>, )
Add a state transition edge
Sourcepub fn add_service_call(
&mut self,
from_node_id: String,
to_node_id: String,
call_label: Option<String>,
)
pub fn add_service_call( &mut self, from_node_id: String, to_node_id: String, call_label: Option<String>, )
Add a service call edge (cross-service communication)
Sourcepub fn add_workspace(
&mut self,
workspace_id: String,
workspace_name: String,
endpoint_ids: Vec<String>,
)
pub fn add_workspace( &mut self, workspace_id: String, workspace_name: String, endpoint_ids: Vec<String>, )
Add a workspace cluster
Sourcepub fn add_service(
&mut self,
service_id: String,
service_name: String,
endpoint_ids: Vec<String>,
)
pub fn add_service( &mut self, service_id: String, service_name: String, endpoint_ids: Vec<String>, )
Add a service cluster (micro-mock)
Sourcepub fn update_node_state(&mut self, node_id: &str, state: String)
pub fn update_node_state(&mut self, node_id: &str, state: String)
Update the current state of a node
Sourcepub fn into_graph(self) -> GraphData
pub fn into_graph(self) -> GraphData
Get the graph data (consumes the builder)
Sourcepub fn from_endpoints(&mut self, endpoints: &[(String, String, String, String)])
pub fn from_endpoints(&mut self, endpoints: &[(String, String, String, String)])
Build graph from UI Builder endpoints
Sourcepub fn from_chains(&mut self, chains: &[ChainDefinition])
pub fn from_chains(&mut self, chains: &[ChainDefinition])
Build graph from chain definitions
Sourcepub fn from_state_machines(&mut self, state_machines: &[StateMachine])
pub fn from_state_machines(&mut self, state_machines: &[StateMachine])
Build graph from state machines
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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> 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