-
Notifications
You must be signed in to change notification settings - Fork 224
Add message components #3393
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
base: 3022-foundry-ui
Are you sure you want to change the base?
Add message components #3393
Conversation
…net-foundry into 3022-2-message-components
…net-foundry into 3022-2-message-components
…net-foundry into 3022-2-message-components
…net-foundry into 3022-2-message-components
…net-foundry into 3022-2-message-components
…net-foundry into 3022-2-message-components
…net-foundry into 3022-2-message-components
…net-foundry into 3022-2-message-components
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.
@@ -64,4 +66,14 @@ impl UI { | |||
OutputFormat::Json => eprintln!("{}", message.json()), | |||
} | |||
} | |||
|
|||
/// Print a warning message to stdout using the configured output format. | |||
pub fn print_warning(&self, text: &str) { |
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.
This is inconsistent with signature print
pub fn print<T>(&self, message: &T)
where
T: Message + serde::Serialize,
#[derive(Serialize)] | ||
pub struct TaggedMessage<'a> { | ||
tag: &'a str, | ||
text: &'a str, |
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.
Shouldn't it be &T where T: Message
?
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.
So we can allow creating Labeled/Tagged
message from normal Message
? Probably makes sense.
#[derive(Serialize)] | ||
pub struct TaggedMessage<'a> { | ||
tag: &'a str, | ||
text: &'a str, |
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.
So we can allow creating Labeled/Tagged
message from normal Message
? Probably makes sense.
} | ||
} | ||
|
||
impl Message for TaggedMessage<'_> { |
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.
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.
Please rename the file
…net-foundry into 3022-2-message-components
…y-rs/starknet-foundry into 3022-2-message-components
Towards #3022
Stack:
docs
crate #3409shared
#3405Introduced changes
Add
TypedMessage
andLabeledMessage
components to foundry-uiChecklist
CHANGELOG.md