Skip to content
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

header field in FollowerSessionRequest will cause duplicate definitions when generated codec for rust #522

Open
rafalpiotrowski opened this issue Sep 6, 2024 · 0 comments

Comments

@rafalpiotrowski
Copy link

rafalpiotrowski commented Sep 6, 2024

sbe generator targeting rust language will generate two functions with name "header"

generated from
artio-codecs/src/main/resources/uk/co/real_logic/artio/messages/message-schema.xml

impl<'a> FollowerSessionRequestEncoder<'a> {
...
       pub fn header(self, offset: usize) -> MessageHeaderEncoder<Self> {
            let mut header = MessageHeaderEncoder::default().wrap(self, offset);
            header.block_length(SBE_BLOCK_LENGTH);
            header.template_id(SBE_TEMPLATE_ID);
            header.schema_id(SBE_SCHEMA_ID);
            header.version(SBE_SCHEMA_VERSION);
            header
        }
...
        #[inline]
        pub fn header(&mut self, value: &[u8]) {
            let limit = self.get_limit();
            let data_length = value.len();
            self.set_limit(limit + 4 + data_length);
            self.get_buf_mut().put_u32_at(limit, data_length as u32);
            self.get_buf_mut().put_slice_at(limit + 4, value);
        }
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant