mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 23:36:20 +00:00
fix(ffi): keep merged children in place and rename PageView to PageData
Merging a first child into its parent now gives its children the merged block's slot instead of appending them after the parent's other children. PageView clashed with Flutter's PageView widget in Dart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
305428eaea
commit
8c11d049fb
5 files changed
+104
-85
No files matched your search
@@ -2148,6 +2148,18 @@ impl SseDecode for Vec<crate::api::dto::PageBrief> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<crate::api::dto::PageData> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut len_ = <i32>::sse_decode(deserializer);
|
||||
let mut ans_ = Vec::with_capacity(len_ as usize);
|
||||
for idx_ in 0..len_ {
|
||||
ans_.push(<crate::api::dto::PageData>::sse_decode(deserializer));
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<crate::api::dto::PageDto> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -2160,18 +2172,6 @@ impl SseDecode for Vec<crate::api::dto::PageDto> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<crate::api::dto::PageView> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut len_ = <i32>::sse_decode(deserializer);
|
||||
let mut ans_ = Vec::with_capacity(len_ as usize);
|
||||
for idx_ in 0..len_ {
|
||||
ans_.push(<crate::api::dto::PageView>::sse_decode(deserializer));
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<u8> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -2242,11 +2242,11 @@ impl SseDecode for Option<crate::api::dto::BlockRefDto> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Option<crate::api::dto::PageView> {
|
||||
impl SseDecode for Option<crate::api::dto::PageData> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
if (<bool>::sse_decode(deserializer)) {
|
||||
return Some(<crate::api::dto::PageView>::sse_decode(deserializer));
|
||||
return Some(<crate::api::dto::PageData>::sse_decode(deserializer));
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
@@ -2267,6 +2267,24 @@ impl SseDecode for crate::api::dto::PageBrief {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::api::dto::PageData {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut var_page = <crate::api::dto::PageDto>::sse_decode(deserializer);
|
||||
let mut var_blocks = <Vec<crate::api::dto::BlockDto>>::sse_decode(deserializer);
|
||||
let mut var_aliases = <Vec<String>>::sse_decode(deserializer);
|
||||
let mut var_prevJournal = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_nextJournal = <Option<String>>::sse_decode(deserializer);
|
||||
return crate::api::dto::PageData {
|
||||
page: var_page,
|
||||
blocks: var_blocks,
|
||||
aliases: var_aliases,
|
||||
prev_journal: var_prevJournal,
|
||||
next_journal: var_nextJournal,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::api::dto::PageDto {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -2287,24 +2305,6 @@ impl SseDecode for crate::api::dto::PageDto {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::api::dto::PageView {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut var_page = <crate::api::dto::PageDto>::sse_decode(deserializer);
|
||||
let mut var_blocks = <Vec<crate::api::dto::BlockDto>>::sse_decode(deserializer);
|
||||
let mut var_aliases = <Vec<String>>::sse_decode(deserializer);
|
||||
let mut var_prevJournal = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_nextJournal = <Option<String>>::sse_decode(deserializer);
|
||||
return crate::api::dto::PageView {
|
||||
page: var_page,
|
||||
blocks: var_blocks,
|
||||
aliases: var_aliases,
|
||||
prev_journal: var_prevJournal,
|
||||
next_journal: var_nextJournal,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::api::dto::Place {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -2736,6 +2736,25 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::dto::PageBrief> for crate::ap
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::api::dto::PageData {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[
|
||||
self.page.into_into_dart().into_dart(),
|
||||
self.blocks.into_into_dart().into_dart(),
|
||||
self.aliases.into_into_dart().into_dart(),
|
||||
self.prev_journal.into_into_dart().into_dart(),
|
||||
self.next_journal.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::dto::PageData {}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::api::dto::PageData> for crate::api::dto::PageData {
|
||||
fn into_into_dart(self) -> crate::api::dto::PageData {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::api::dto::PageDto {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[
|
||||
@@ -2756,25 +2775,6 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::dto::PageDto> for crate::api:
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::api::dto::PageView {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[
|
||||
self.page.into_into_dart().into_dart(),
|
||||
self.blocks.into_into_dart().into_dart(),
|
||||
self.aliases.into_into_dart().into_dart(),
|
||||
self.prev_journal.into_into_dart().into_dart(),
|
||||
self.next_journal.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::api::dto::PageView {}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::api::dto::PageView> for crate::api::dto::PageView {
|
||||
fn into_into_dart(self) -> crate::api::dto::PageView {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::api::dto::Place {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[
|
||||
@@ -3064,6 +3064,16 @@ impl SseEncode for Vec<crate::api::dto::PageBrief> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<crate::api::dto::PageData> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<i32>::sse_encode(self.len() as _, serializer);
|
||||
for item in self {
|
||||
<crate::api::dto::PageData>::sse_encode(item, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<crate::api::dto::PageDto> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -3074,16 +3084,6 @@ impl SseEncode for Vec<crate::api::dto::PageDto> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<crate::api::dto::PageView> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<i32>::sse_encode(self.len() as _, serializer);
|
||||
for item in self {
|
||||
<crate::api::dto::PageView>::sse_encode(item, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<u8> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -3144,12 +3144,12 @@ impl SseEncode for Option<crate::api::dto::BlockRefDto> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Option<crate::api::dto::PageView> {
|
||||
impl SseEncode for Option<crate::api::dto::PageData> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<bool>::sse_encode(self.is_some(), serializer);
|
||||
if let Some(value) = self {
|
||||
<crate::api::dto::PageView>::sse_encode(value, serializer);
|
||||
<crate::api::dto::PageData>::sse_encode(value, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3163,6 +3163,17 @@ impl SseEncode for crate::api::dto::PageBrief {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::api::dto::PageData {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<crate::api::dto::PageDto>::sse_encode(self.page, serializer);
|
||||
<Vec<crate::api::dto::BlockDto>>::sse_encode(self.blocks, serializer);
|
||||
<Vec<String>>::sse_encode(self.aliases, serializer);
|
||||
<Option<String>>::sse_encode(self.prev_journal, serializer);
|
||||
<Option<String>>::sse_encode(self.next_journal, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::api::dto::PageDto {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -3175,17 +3186,6 @@ impl SseEncode for crate::api::dto::PageDto {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::api::dto::PageView {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<crate::api::dto::PageDto>::sse_encode(self.page, serializer);
|
||||
<Vec<crate::api::dto::BlockDto>>::sse_encode(self.blocks, serializer);
|
||||
<Vec<String>>::sse_encode(self.aliases, serializer);
|
||||
<Option<String>>::sse_encode(self.prev_journal, serializer);
|
||||
<Option<String>>::sse_encode(self.next_journal, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::api::dto::Place {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
|
||||
Reference in new issue
Block a user