Skip to content

Commit

Permalink
Derive Clone and Debug for EndpointState types (#263)
Browse files Browse the repository at this point in the history
This ensures that `Client` implements both traits.
  • Loading branch information
avtrujillo authored Mar 29, 2024
1 parent d32a540 commit e2e8a62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@ pub trait EndpointState: private::EndpointStateSealed {}

/// [Typestate](https://cliffle.com/blog/rust-typestate/) indicating that an endpoint has not been
/// set and cannot be used.
#[derive(Clone, Debug)]
pub struct EndpointNotSet;
impl EndpointState for EndpointNotSet {}
impl private::EndpointStateSealed for EndpointNotSet {}

/// [Typestate](https://cliffle.com/blog/rust-typestate/) indicating that an endpoint has been set
/// and is ready to be used.
#[derive(Clone, Debug)]
pub struct EndpointSet;
impl EndpointState for EndpointSet {}
impl private::EndpointStateSealed for EndpointSet {}

/// [Typestate](https://cliffle.com/blog/rust-typestate/) indicating that an endpoint may have been
/// set and can be used via fallible methods.
#[derive(Clone, Debug)]
pub struct EndpointMaybeSet;
impl EndpointState for EndpointMaybeSet {}
impl private::EndpointStateSealed for EndpointMaybeSet {}
Expand Down

0 comments on commit e2e8a62

Please sign in to comment.