You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not ideal, as the entire string value ("Hi!") has to be sent over the wire rather than just an index.
Therefore, we'd also like to support passing interned (i.e. predefined) string literals to a format string, like so:
introduce a new formatting parameter (for example {:istr}– preferrably a name that is less similar to the already-existing {:str})
extend parser/lib.rs to recognize the new formatting parameter
extend parse_args to handle this parameter (implementation note from @japaric: &'t str in them would be pointing into the table: &'t [u8] (like the Format.format string does) not into bytes. Rationale: table lives for as long as the decoder/printer program is running (i.e. effectively it will never be deallocated); on the other hand, bytes may be a temporary stack allocated buffer.)
extend docs to explain the difference
add tests
The text was updated successfully, but these errors were encountered:
currently, binfmt only supports passing string values to a format string, like so:
This is not ideal, as the entire string value ("Hi!") has to be sent over the wire rather than just an index.
Therefore, we'd also like to support passing interned (i.e. predefined) string literals to a format string, like so:
To do this, we'll need to
{:istr}
– preferrably a name that is less similar to the already-existing{:str}
)parser/lib.rs
to recognize the new formatting parameterparse_args
to handle this parameter (implementation note from @japaric: &'t str in them would be pointing into the table: &'t [u8] (like the Format.format string does) not into bytes. Rationale: table lives for as long as the decoder/printer program is running (i.e. effectively it will never be deallocated); on the other hand, bytes may be a temporary stack allocated buffer.)The text was updated successfully, but these errors were encountered: