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

Can not read a large template #6

Closed
GeneL opened this issue Feb 28, 2022 · 3 comments
Closed

Can not read a large template #6

GeneL opened this issue Feb 28, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@GeneL
Copy link

GeneL commented Feb 28, 2022

let template = client.find_template(tag_info.1).await?;
println!("template instance:\n{:?}", template);

These statements work for a small (<500 bytes) templates, but do not work for a large (>500 bytes) templates:

let info = client.read_template(&template).call().await?;
println!("template definition:\n{:?}", info);
@Joylei Joylei added question Further information is requested bug Something isn't working and removed question Further information is requested labels Mar 1, 2022
@Joylei
Copy link
Owner

Joylei commented Mar 1, 2022

It was fixed in release v0.2.1. please reopen the issue if it's not working.

@Joylei Joylei closed this as completed Mar 1, 2022
@GeneL
Copy link
Author

GeneL commented Mar 1, 2022

let template = client.find_template(instance_id).await?;
println!("template instance:\n{:?}", template);
let info = client.read_template(&template).call().await?;
println!("template definition:\n{:?}", info);

Result:

template instance:
Template { instance_id: 393, handle: 57110, member_count: 7, object_size: 35, struct_size: 28 }
template definition:
TemplateDefinition { name: "DateTime", members: {"Hr": MemberInfo { name: "Hr", array_size: 0, type_info: SymbolType { type: "atomic", dims: 0, type_code: 0xc4 }, offset: 12 }, "Sec": MemberInfo { name: "Sec", array_size: 0, type_info: SymbolType { type: "atomic", dims: 0, type_code: 0xc4 }, offset: 20 }, "Da": MemberInfo {.......

It works for small struct. In this case the size is: 28.

In case of a large struct 1868 I get these errors:
template instance:
Template { instance_id: 1575, handle: 13998, member_count: 233, object_size: 1411, struct_size: 1868 }
thread 'main' panicked at 'assertion failed: self.remaining() >= dst.len()', bytes-1.1.0/src/buf/buf_impl.rs:253:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@Joylei Joylei reopened this Mar 2, 2022
@Joylei
Copy link
Owner

Joylei commented Mar 2, 2022

can you provide the detailed backtrace?

Joylei added a commit that referenced this issue Mar 3, 2022
- fix read template #6
@Joylei Joylei closed this as completed Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants