pub struct CodeGraphPublisher { /* private fields */ }Expand description
Publishes code graph updates to NATS.
Implementations§
Source§impl CodeGraphPublisher
impl CodeGraphPublisher
Sourcepub async fn new(
nats_url: &str,
agent_name: &str,
) -> Result<Self, Box<dyn Error + Send + Sync>>
pub async fn new( nats_url: &str, agent_name: &str, ) -> Result<Self, Box<dyn Error + Send + Sync>>
Connect to NATS and create a publisher.
Sourcepub fn client_ref(&self) -> &Client
pub fn client_ref(&self) -> &Client
Get a reference to the NATS client (for fire-and-forget from sync handlers).
Sourcepub async fn publish(
&self,
update: &CodeGraphUpdate,
) -> Result<(), PublishError>
pub async fn publish( &self, update: &CodeGraphUpdate, ) -> Result<(), PublishError>
Publish a code graph update.
Sourcepub fn make_update(
&self,
node_id: &str,
new_body: &str,
body_hash: &str,
rationale: &str,
) -> CodeGraphUpdate
pub fn make_update( &self, node_id: &str, new_body: &str, body_hash: &str, rationale: &str, ) -> CodeGraphUpdate
Create an update event for a node replacement.
Auto Trait Implementations§
impl !RefUnwindSafe for CodeGraphPublisher
impl !UnwindSafe for CodeGraphPublisher
impl Freeze for CodeGraphPublisher
impl Send for CodeGraphPublisher
impl Sync for CodeGraphPublisher
impl Unpin for CodeGraphPublisher
impl UnsafeUnpin for CodeGraphPublisher
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