This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git
The following commit(s) were added to refs/heads/main by this push:
new 59a3806ca π synced local 'docs/guide/' with remote 'docs/guide/'
59a3806ca is described below
commit 59a3806ca8e7afb48ac706474563bb341aeb5314
Author: chaokunyang <[email protected]>
AuthorDate: Mon Apr 20 12:52:26 2026 +0000
π synced local 'docs/guide/' with remote 'docs/guide/'
---
docs/guide/python/cross-language.md | 4 ++--
docs/guide/rust/configuration.md | 20 ++++++++++----------
docs/guide/rust/cross-language.md | 12 ++++++------
docs/guide/rust/polymorphism.md | 4 ++--
docs/guide/rust/schema-evolution.md | 6 +++---
docs/guide/rust/troubleshooting.md | 2 +-
docs/guide/rust/type-registration.md | 4 ++--
docs/guide/xlang/field-reference-tracking.md | 6 +++---
docs/guide/xlang/getting-started.md | 4 ++--
docs/guide/xlang/serialization.md | 4 ++--
10 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/docs/guide/python/cross-language.md
b/docs/guide/python/cross-language.md
index 0a75e0581..b5b96f5ca 100644
--- a/docs/guide/python/cross-language.md
+++ b/docs/guide/python/cross-language.md
@@ -85,9 +85,9 @@ struct Person {
age: i32,
}
-let mut fory = Fory::default()
+let mut fory = Fory::builder()
.compatible(true)
- .xlang(true);
+ .xlang(true).build();
fory.register_by_namespace::<Person>("example", "Person");
let person: Person = fory.deserialize(&binary_data)?;
diff --git a/docs/guide/rust/configuration.md b/docs/guide/rust/configuration.md
index 52d741472..dd6435ee3 100644
--- a/docs/guide/rust/configuration.md
+++ b/docs/guide/rust/configuration.md
@@ -38,7 +38,7 @@ let fory = Fory::default(); // SchemaConsistent by default
Allows independent schema evolution:
```rust
-let fory = Fory::default().compatible(true);
+let fory = Fory::builder().compatible(true).build();
```
## Configuration
@@ -56,7 +56,7 @@ let fory = Fory::default(); // max_dyn_depth = 5
**Custom depth limit:**
```rust
-let fory = Fory::default().max_dyn_depth(10); // Allow up to 10 levels
+let fory = Fory::builder().max_dyn_depth(10).build(); // Allow up to 10 levels
```
**When to adjust:**
@@ -79,9 +79,9 @@ Note: Static data types (non-dynamic types) are secure by
nature and not subject
Enable cross-language serialization:
```rust
-let fory = Fory::default()
+let fory = Fory::builder()
.compatible(true)
- .xlang(true);
+ .xlang(true).build();
```
## Builder Pattern
@@ -93,21 +93,21 @@ use fory::Fory;
let fory = Fory::default();
// Compatible mode for schema evolution
-let fory = Fory::default().compatible(true);
+let fory = Fory::builder().compatible(true).build();
// Cross-language mode
-let fory = Fory::default()
+let fory = Fory::builder()
.compatible(true)
- .xlang(true);
+ .xlang(true).build();
// Custom depth limit
-let fory = Fory::default().max_dyn_depth(10);
+let fory = Fory::builder().max_dyn_depth(10).build();
// Combined configuration
-let fory = Fory::default()
+let fory = Fory::builder()
.compatible(true)
.xlang(true)
- .max_dyn_depth(10);
+ .max_dyn_depth(10).build();
```
## Configuration Summary
diff --git a/docs/guide/rust/cross-language.md
b/docs/guide/rust/cross-language.md
index fb0ff5377..dac48ec6a 100644
--- a/docs/guide/rust/cross-language.md
+++ b/docs/guide/rust/cross-language.md
@@ -27,9 +27,9 @@ Apache Foryβ’ supports seamless data exchange across multiple
languages includi
use fory::Fory;
// Enable cross-language mode
-let mut fory = Fory::default()
+let mut fory = Fory::builder()
.compatible(true)
- .xlang(true);
+ .xlang(true).build();
// Register types with consistent IDs across languages
fory.register::<MyStruct>(100);
@@ -45,9 +45,9 @@ fory.register_by_namespace::<MyStruct>("com.example",
"MyStruct");
For fast, compact serialization with consistent IDs across languages:
```rust
-let mut fory = Fory::default()
+let mut fory = Fory::builder()
.compatible(true)
- .xlang(true);
+ .xlang(true).build();
fory.register::<User>(100); // Same ID in Java, Python, etc.
```
@@ -74,9 +74,9 @@ struct Person {
age: i32,
}
-let mut fory = Fory::default()
+let mut fory = Fory::builder()
.compatible(true)
- .xlang(true);
+ .xlang(true).build();
fory.register::<Person>(100);
diff --git a/docs/guide/rust/polymorphism.md b/docs/guide/rust/polymorphism.md
index 80d2bb2c0..2afff965d 100644
--- a/docs/guide/rust/polymorphism.md
+++ b/docs/guide/rust/polymorphism.md
@@ -64,7 +64,7 @@ struct Zoo {
star_animal: Box<dyn Animal>,
}
-let mut fory = Fory::default().compatible(true);
+let mut fory = Fory::builder().compatible(true).build();
fory.register::<Dog>(100);
fory.register::<Cat>(101);
fory.register::<Zoo>(102);
@@ -153,7 +153,7 @@ struct AnimalShelter {
registry: HashMap<String, Arc<dyn Animal>>,
}
-let mut fory = Fory::default().compatible(true);
+let mut fory = Fory::builder().compatible(true).build();
fory.register::<Dog>(100);
fory.register::<Cat>(101);
fory.register::<AnimalShelter>(102);
diff --git a/docs/guide/rust/schema-evolution.md
b/docs/guide/rust/schema-evolution.md
index f58db6ad0..6b51ba1ac 100644
--- a/docs/guide/rust/schema-evolution.md
+++ b/docs/guide/rust/schema-evolution.md
@@ -47,10 +47,10 @@ struct PersonV2 {
metadata: HashMap<String, String>,
}
-let mut fory1 = Fory::default().compatible(true);
+let mut fory1 = Fory::builder().compatible(true).build();
fory1.register::<PersonV1>(1);
-let mut fory2 = Fory::default().compatible(true);
+let mut fory2 = Fory::builder().compatible(true).build();
fory2.register::<PersonV2>(1);
let person_v1 = PersonV1 {
@@ -155,7 +155,7 @@ enum NewEvent {
KeyPress(String), // New variant
}
-let mut fory = Fory::default().compatible(true);
+let mut fory = Fory::builder().compatible(true).build();
// Serialize with old schema
let old_bytes = fory.serialize(&OldEvent::Click { x: 100, y: 200 })?;
diff --git a/docs/guide/rust/troubleshooting.md
b/docs/guide/rust/troubleshooting.md
index f67f5071a..6d99c551b 100644
--- a/docs/guide/rust/troubleshooting.md
+++ b/docs/guide/rust/troubleshooting.md
@@ -51,7 +51,7 @@ Confirm that:
- Ensure field types match across versions
```rust
-let fory = Fory::default().compatible(true);
+let fory = Fory::builder().compatible(true).build();
```
## Debugging Techniques
diff --git a/docs/guide/rust/type-registration.md
b/docs/guide/rust/type-registration.md
index 0c209ce55..d44d0094a 100644
--- a/docs/guide/rust/type-registration.md
+++ b/docs/guide/rust/type-registration.md
@@ -52,9 +52,9 @@ let decoded: User = fory.deserialize(&bytes)?;
For cross-language compatibility, register with namespace and type name:
```rust
-let mut fory = Fory::default()
+let mut fory = Fory::builder()
.compatible(true)
- .xlang(true);
+ .xlang(true).build();
// Register with namespace-based naming
fory.register_by_namespace::<MyStruct>("com.example", "MyStruct")?;
diff --git a/docs/guide/xlang/field-reference-tracking.md
b/docs/guide/xlang/field-reference-tracking.md
index f6076c13c..d7729c240 100644
--- a/docs/guide/xlang/field-reference-tracking.md
+++ b/docs/guide/xlang/field-reference-tracking.md
@@ -64,9 +64,9 @@ auto fory =
fory::Fory::builder().xlang(true).track_ref(true).build();
### Rust
```rust
-let fory = Fory::default()
+let fory = Fory::builder()
.xlang(true)
- .track_ref(true);
+ .track_ref(true).build();
```
## Wire Format
@@ -158,7 +158,7 @@ FORY_STRUCT(Document, title, author, data, tag_owner);
```
To disable reference tracking for C++ entirely, set
-`Fory::builder().track_ref(false)` on the serializer.
+`Fory::builder().track_ref(false).build()` on the serializer.
#### Rust: Field Attributes
diff --git a/docs/guide/xlang/getting-started.md
b/docs/guide/xlang/getting-started.md
index ae0d2a17c..9cc41d5fe 100644
--- a/docs/guide/xlang/getting-started.md
+++ b/docs/guide/xlang/getting-started.md
@@ -113,7 +113,7 @@ fory := forygo.NewFory(forygo.WithXlang(true),
forygo.WithTrackRef(true))
```rust
use fory::Fory;
-let fory = Fory::default().xlang(true);
+let fory = Fory::builder().xlang(true).build();
```
### JavaScript
@@ -173,7 +173,7 @@ struct Person {
age: i32,
}
-let mut fory = Fory::default().xlang(true);
+let mut fory = Fory::builder().xlang(true).build();
fory
.register_by_namespace::<Person>("example", "Person")
.expect("register Person");
diff --git a/docs/guide/xlang/serialization.md
b/docs/guide/xlang/serialization.md
index c9b270ebd..a646db6e5 100644
--- a/docs/guide/xlang/serialization.md
+++ b/docs/guide/xlang/serialization.md
@@ -133,7 +133,7 @@ console.log(result);
use fory::Fory;
fn run() {
- let fory = Fory::default().xlang(true);
+ let fory = Fory::builder().xlang(true).build();
let bin = fory.serialize(&"hello".to_string()).expect("serialize success");
let obj: String = fory.deserialize(&bin).expect("deserialize success");
assert_eq!("hello".to_string(), obj);
@@ -399,7 +399,7 @@ fn complex_struct() {
c6: 4.0,
};
- let mut fory = Fory::default().xlang(true);
+ let mut fory = Fory::builder().xlang(true).build();
fory
.register_by_namespace::<Animal>("example", "foo2")
.expect("register Animal");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]