-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating with StaticVersionType #188
Conversation
examples/hello-world/main.rs
Outdated
@@ -39,11 +43,11 @@ impl From<RequestError> for HelloError { | |||
} | |||
|
|||
async fn serve(port: u16) -> io::Result<()> { | |||
let mut app = App::<_, HelloError, 0, 1>::with_state(RwLock::new("Hello".to_string())); | |||
let mut app = App::<_, HelloError, Ver01>::with_state(RwLock::new("Hello".to_string())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really familiar with the code in this repo, but it looks like there are multiple different names for the same thing. Is this intentional?
There's Ver01
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not so much intentional as the inevitable consequence of how rust's doctest works. Each doctest instance is basically its own isolated sandbox. Likewise for examples. There's nothing special about these aliases, they're just convent for illustrating that, in real usage, you would be using something external rather than hardcoding StaticVersion<0, 1>
as a parameter.
/// # const MINOR: u16 = 1; | ||
/// # fn ex(api: &mut tide_disco::Api<(), (), MAJOR, MINOR>) { | ||
/// # use versioned_binary_serialization::version::StaticVersion; | ||
/// # type StaticVer01 = StaticVersion<0, 1>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StaticVer01
here
src/api.rs
Outdated
@@ -1376,7 +1386,7 @@ mod test { | |||
|
|||
#[async_std::test] | |||
async fn test_socket_endpoint() { | |||
let mut app = App::<_, ServerError, 0, 1>::with_state(RwLock::new(())); | |||
let mut app = App::<_, ServerError, StaticVersion01>::with_state(RwLock::new(())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StaticVersion01
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just three different contexts, each with a local alias...
One positive here is, I've figured out how to bind the version from the sequencer to HotShot, such that we can schedule updates without changing HotShot if we need to.