git.delta.rocks / remowt / refs/commits / 31b564729082

difftreelog

source

crates/remowt-link-shared/src/lib.rs1005 Bsourcehistory
1use bifrostlink::error::{ErrorT, ListenerForYourRequestHasBeenDeadError, ResponseError};2use bifrostlink::AddressT;3use serde::{Deserialize, Serialize};45#[derive(Clone, Serialize, Hash, Eq, Debug, PartialEq, Deserialize)]6pub enum Address {7	User,8    Agent,9}10impl AddressT for Address {}1112#[derive(thiserror::Error, Debug)]13pub enum Error {14    #[error("listener is dead")]15    ListenerDead,16    #[error("response: {0}")]17    Response(String),18}19impl From<ListenerForYourRequestHasBeenDeadError> for Error {20    fn from(_value: ListenerForYourRequestHasBeenDeadError) -> Self {21        Self::ListenerDead22    }23}24impl From<serde_json::Error> for Error {25    fn from(_value: serde_json::Error) -> Self {26        Self::ListenerDead27    }28}29impl From<Error> for ResponseError {30    fn from(val: Error) -> Self {31        ResponseError(val.to_string())32    }33}34impl From<ResponseError> for Error {35    fn from(value: ResponseError) -> Self {36        Self::Response(value.0)37    }38}39impl ErrorT for Error {}