Closed satoren closed 1 month ago
The pull request introduces significant changes across multiple files in the native/yex/src
directory, primarily focusing on the restructuring of reference handling for various data types, including arrays, maps, text, and XML. The main alteration involves replacing the NifSharedType
with SharedTypeId
, affecting how references are managed. New implementations of the NifSharedType
trait are added for several structures, enhancing encapsulation and simplifying method interactions. Additionally, methods for manipulating these structures are updated to streamline access to references and improve error handling.
File | Change Summary |
---|---|
native/yex/src/array.rs | - Changed reference type from NifSharedType<ArrayRef> to SharedTypeId<ArrayRef> .- Added impl NifSharedType for NifArray with methods for document and reference access.- Updated methods: array_insert , array_insert_list , array_length , array_get , array_delete_range , array_to_list , array_to_json to use new methods directly. |
native/yex/src/map.rs | - Changed reference type from NifSharedType<MapRef> to SharedTypeId<MapRef> .- Added impl NifSharedType for NifMap with methods for document and reference access.- Updated methods: map_set , map_size , map_get , map_delete , map_to_map , map_to_json to use new methods directly. |
native/yex/src/shared_type.rs | - Renamed NifSharedType<T> to SharedTypeId<T> .- Updated Encoder and Decoder implementations to use SharedTypeId .- Introduced new trait NifSharedType with various methods for shared type operations. |
native/yex/src/text.rs | - Changed TextRefId type from NifSharedType<TextRef> to SharedTypeId<TextRef> .- Added impl NifSharedType for NifText with methods for document and reference access.- Updated methods: text_insert , text_insert_with_attributes , text_delete , text_format , text_to_string , text_length , text_to_delta , text_apply_delta to use new methods directly. |
native/yex/src/xml.rs | - Changed types: XmlFragmentId , XmlElementId , XmlTextId from NifSharedType to SharedTypeId .- Added impl NifSharedType for NifXmlFragment , NifXmlElement , and NifXmlText with methods for document and reference access.- Updated XML manipulation methods to use new shared type handling. |
native/yex/src/error.rs | - Removed DeletedSharedTypeError struct and deleted_error function, along with associated imports. |
SliceIntoBinary
struct, which alters how binary slices are encoded, similar to the changes in the main PR where the handling of references in various structures is redefined. Both PRs reflect a shift in how data types are managed and accessed, indicating a related focus on improving encapsulation and clarity in the code.🐇 In the meadow, we hop and play,
With shared types brightening our day.
From arrays to maps, we leap with glee,
Encapsulation sets our data free!
Text and XML, all in a row,
Together we flourish, watch us grow! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores