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

How would you go about implementing a Drop #521

Open
ggallovalle opened this issue Nov 22, 2023 · 3 comments
Open

How would you go about implementing a Drop #521

ggallovalle opened this issue Nov 22, 2023 · 3 comments

Comments

@ggallovalle
Copy link

liquid-rust version:
rust version:
OS:

As per the official Ruby implementation example

image

https://rubydoc.info/gems/liquid/Liquid/Drop

@epage
Copy link
Member

epage commented Nov 24, 2023

You can implement your own data type through ValueView / ObjectView. We don't support calling custom functions but you can expose getters / setters as just fields.

@ggallovalle
Copy link
Author

If I do that the root struct passed to render must be custom because model::Object do not have methods to store other ObjectView

Am I right?

@epage
Copy link
Member

epage commented Nov 27, 2023

At this time, yes. We could explore a Value being able to contain a ValueView but it would be good to have an understanding of the use cases so we can make the appropriate trade offs.

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

2 participants