pub struct SheetSync { /* private fields */ }Expand description
Keeps character sheets in step with combats: hit points, and slots and uses spent or given back.
Implementations§
Source§impl SheetSync
impl SheetSync
Sourcepub fn new(
store: Store,
login: Arc<ServiceLogin>,
character_service: String,
) -> Self
pub fn new( store: Store, login: Arc<ServiceLogin>, character_service: String, ) -> Self
Writes to the character service at character_service, logged in
to with login.
Sourcepub async fn played_by(
&self,
campaign: Uuid,
device: &str,
) -> Result<HashSet<Uuid>, ClientError>
pub async fn played_by( &self, campaign: Uuid, device: &str, ) -> Result<HashSet<Uuid>, ClientError>
The characters of campaign that the player device device (a key)
plays.
Sourcepub async fn spend(
&self,
campaign: Uuid,
character: Uuid,
cost: &SheetCost,
command: Uuid,
) -> Result<(), ClientError>
pub async fn spend( &self, campaign: Uuid, character: Uuid, cost: &SheetCost, command: Uuid, ) -> Result<(), ClientError>
Spends cost on character’s sheet for command, once however
often the command is sent.
Sourcepub async fn give_back(
&self,
campaign: Uuid,
character: Uuid,
cost: &SheetCost,
key: Uuid,
) -> Result<(), ClientError>
pub async fn give_back( &self, campaign: Uuid, character: Uuid, cost: &SheetCost, key: Uuid, ) -> Result<(), ClientError>
Gives cost back to character’s sheet, once per key.
Sourcepub async fn run(self: Arc<Self>, combat: Uuid)
pub async fn run(self: Arc<Self>, combat: Uuid)
Syncs combat until it is up to date, unless another instance is
already on it (that instance then picks up anything new too).
Sourcepub async fn retry_forever(self: Arc<Self>)
pub async fn retry_forever(self: Arc<Self>)
Retries failed write-backs every 30 seconds, for as long as the service runs.
Auto Trait Implementations§
impl Freeze for SheetSync
impl !RefUnwindSafe for SheetSync
impl Send for SheetSync
impl Sync for SheetSync
impl Unpin for SheetSync
impl UnsafeUnpin for SheetSync
impl !UnwindSafe for SheetSync
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more
§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension. Read more
§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension, using
x-request-id as the header name. Read more§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses. Read more
§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses, using
x-request-id as the header name. Read more