We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I don't want set key in BaseRecord like this
let br = BaseRecord::with_opaque_to("flow-file-info", ()).payload(fi);
but hint
impl<'a, K: ToBytes + ?Sized, P: ToBytes + ?Sized, D: IntoOpaque> BaseRecord<'a, K, P, D> { ^^^^^^^ required by this bound in `BaseRecord::<'a, K, P, D>::with_opaque_to`
so, I fix like this
let br = BaseRecord::with_opaque_to("flow-file-info", ()).payload(fi).key("");
how do I set key as none?
The text was updated successfully, but these errors were encountered:
Take a look at the BaseRecord definition:
BaseRecord
pub struct BaseRecord<'a, K: ToBytes + ?Sized = (), P: ToBytes + ?Sized = (), D: IntoOpaque = ()> { /// Required destination topic. pub topic: &'a str, /// Optional destination partition. pub partition: Option<i32>, /// Optional payload. pub payload: Option<&'a P>, /// Optional key. pub key: Option<&'a K>, /// Optional timestamp. /// /// Note that Kafka represents timestamps as the number of milliseconds /// since the Unix epoch. pub timestamp: Option<i64>, /// Optional message headers. pub headers: Option<OwnedHeaders>, /// Required delivery opaque (defaults to `()` if not required). pub delivery_opaque: D, }
It takes 3 generics and defaults to () when you dont set them.
You can just not set your .key(...) and specify your type. Also, opaque is () by default if you don't want to use it just use BaseRecord::to(topic).
.key(...)
()
BaseRecord::to(topic)
let br: BaseRecord<'_, (), [u8]> = BaseRecord::to(topic).payload(&payload[..]);
Sorry, something went wrong.
No branches or pull requests
I don't want set key in BaseRecord like this
but hint
so, I fix like this
how do I set key as none?
The text was updated successfully, but these errors were encountered: