### Install Snapshot Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftApp.html Replaces the application's current state with the provided snapshot. The snapshot is guaranteed to exist. ```rust fn install_snapshot<'life0, 'async_trait>( &'life0 self, snapshot_index: Index, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### Example: Using `Pin::set` to Update a Pinned Value Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Shows how to use `Pin::set` to change the value of a mutable reference that has been pinned. ```rust use std::pin::Pin; let mut val: u8 = 5; let mut pinned: Pin<&mut u8> = Pin::new(&mut val); println!("{}", pinned); // 5 pinned.set(10); println!("{}", pinned); // 10 ``` -------------------------------- ### Example: Calling a Method Twice on a Pinned Self Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Demonstrates how to safely call a method that consumes `self` multiple times on a `Pin<&mut Self>` by using `as_mut` to reborrow. ```rust use std::pin::Pin; impl Type { fn method(self: Pin<&mut Self>) { // do something } fn call_method_twice(mut self: Pin<&mut Self>) { // `method` consumes `self`, so reborrow the `Pin<&mut Self>` via `as_mut`. self.as_mut().method(); self.as_mut().method(); } } ``` -------------------------------- ### Get Head Index from RaftLogStore Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftLogStore.html Asynchronously retrieves the index of the first entry in the log. This is useful for determining the start of the valid log. ```rust fn get_head_index<'life0, 'async_trait>( &'life0 self, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### Get Entry from RaftLogStore Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftLogStore.html Asynchronously retrieves a log entry at a specific index. Returns `Ok(Some(Entry))` if found, `Ok(None)` if the index does not exist, or `Err` on failure. ```rust fn get_entry<'life0, 'async_trait>( &'life0 self, i: Index, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### Unsafe Pinning with Rc Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html This example shows the unsafety of using `Pin::new_unchecked` with `Rc`. It illustrates how aliasing through `Rc` can allow mutation of pinned data, violating the pinning contract. ```rust use std::rc::Rc; use std::pin::Pin; fn move_pinned_rc(mut x: Rc) { // This should mean the pointee can never move again. let pin = unsafe { Pin::new_unchecked(Rc::clone(&x)) }; { let p: Pin<&T> = pin.as_ref(); // ... } drop(pin); let content = Rc::get_mut(&mut x).unwrap(); // Potential UB down the road ⚠️ // Now, if `x` was the only reference, we have a mutable reference to // data that we pinned above, which we could use to move it as we have // seen in the previous example. We have violated the pinning API contract. } ``` -------------------------------- ### Unsafe Pinning with Mutable References Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html This example demonstrates how using `Pin::new_unchecked` with a mutable reference can lead to undefined behavior if the underlying data is moved after pinning. It highlights a violation of the pinning API contract. ```rust use std::mem; use std::pin::Pin; fn move_pinned_ref(mut a: T, mut b: T) { unsafe { let p: Pin<&mut T> = Pin::new_unchecked(&mut a); // This should mean the pointee `a` can never move again. } mem::swap(&mut a, &mut b); // Potential UB down the road ⚠️ // The address of `a` changed to `b`'s stack slot, so `a` got moved even // though we have previously pinned it! We have violated the pinning API contract. } ``` -------------------------------- ### install_snapshot Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftApp.html Replace the current application state with the provided snapshot. The snapshot is guaranteed to be available in the snapshot store. ```APIDOC ## install_snapshot ### Description Replace the state of the application with the snapshot. The snapshot is guaranteed to exist in the snapshot store. ### Method Signature `fn install_snapshot<'life0, 'async_trait>( &'life0 self, snapshot_index: Index, ) -> Pin> + Send + 'async_trait>>` ### Parameters * `snapshot_index` (Index) - The index of the snapshot to install. ### Type Constraints `where Self: 'async_trait, 'life0: 'async_trait` ``` -------------------------------- ### Create a new ServerReflectionServer Source: https://docs.rs/lolraft/0.10.2/lolraft/reflection_service/fn.new.html Use this function to instantiate a `ServerReflectionServer`. It returns a `ServerReflectionServer` ready to handle reflection requests. ```rust pub fn new() -> ServerReflectionServer ``` -------------------------------- ### Get RaftDriver for a Lane Source: https://docs.rs/lolraft/0.10.2/lolraft/struct.RaftNode.html Retrieves a RaftDriver instance for a specific lane. This driver is used to control the Raft process on that lane. ```rust pub fn get_driver(&self, lane_id: LaneId) -> RaftDriver ``` -------------------------------- ### new Source: https://docs.rs/lolraft/0.10.2/lolraft/raft_service/fn.new.html Creates a Raft service instance backed by a `RaftNode`. ```APIDOC ## new lolraft::raft_service ### Description Create a Raft service backed by a `RaftNode`. ### Signature ```rust pub fn new(node: RaftNode) -> RaftServer ``` ### Parameters #### Path Parameters - **node** (RaftNode) - Required - The RaftNode to back the service. ### Returns - **RaftServer** - A new Raft server instance. ``` -------------------------------- ### Pointable::deref() Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Ballot.html Dereferences the given pointer to get an immutable reference. This is an unsafe function as part of the Pointable trait. ```rust unsafe fn deref<'a>(ptr: usize) -> &'a T ``` -------------------------------- ### new Source: https://docs.rs/lolraft/0.10.2/lolraft/reflection_service/fn.new.html Creates a new reflection service instance. ```APIDOC ## new lolraft::reflection_service ### Function Signature ```rust pub fn new() -> ServerReflectionServer ``` ### Description Creates a reflection service. ``` -------------------------------- ### Get Last Index from RaftLogStore Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftLogStore.html Asynchronously retrieves the index of the last entry in the log. This indicates the current end of the log. ```rust fn get_last_index<'life0, 'async_trait>( &'life0 self, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### Initialization and Dereferencing Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.ReadRequest.html Methods for initializing, dereferencing, and mutably dereferencing a pointer. ```APIDOC ## unsafe fn init(init: ::Init) -> usize ### Description Initializes a with the given initializer. ### Method unsafe fn init ### Parameters #### Path Parameters - **init** (::Init) - Required - The initializer for the object. ### Response #### Success Response (usize) - **usize** - The pointer to the initialized object. ## unsafe fn deref<'a>(ptr: usize) -> &'a T ### Description Dereferences the given pointer. ### Method unsafe fn deref ### Parameters #### Path Parameters - **ptr** (usize) - Required - The pointer to dereference. ### Response #### Success Response (&'a T) - **&'a T** - A reference to the object at the given pointer. ## unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T ### Description Mutably dereferences the given pointer. ### Method unsafe fn deref_mut ### Parameters #### Path Parameters - **ptr** (usize) - Required - The pointer to mutably dereference. ### Response #### Success Response (&'a mut T) - **&'a mut T** - A mutable reference to the object at the given pointer. ``` -------------------------------- ### Pin::as_deref_mut Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Gets `Pin<&mut T>` to the underlying pinned value from this nested `Pin`-pointer. This method does not enable the pointee to move. ```APIDOC ## pub fn as_deref_mut( self: Pin<&mut Pin>, ) -> Pin<&mut ::Target> ### Description Gets `Pin<&mut T>` to the underlying pinned value from this nested `Pin`-pointer. This is a generic method to go from `Pin<&mut Pin>>` to `Pin<&mut T>`. It is safe because the existence of a `Pin>` ensures that the pointee, `T`, cannot move in the future, and this method does not enable the pointee to move. “Malicious” implementations of `Ptr::DerefMut` are likewise ruled out by the contract of `Pin::new_unchecked`. ### Method `as_deref_mut` ``` -------------------------------- ### Pin::as_ref Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Gets a shared reference to the pinned value this `Pin` points to. This is safe because the pointee cannot move after `Pin::new_unchecked` is created. ```APIDOC ## pub fn as_ref(&self) -> Pin<&::Target> ### Description Gets a shared reference to the pinned value this `Pin` points to. This is a generic method to go from `&Pin>` to `Pin<&T>`. It is safe because, as part of the contract of `Pin::new_unchecked`, the pointee cannot move after `Pin>` got created. “Malicious” implementations of `Pointer::Deref` are likewise ruled out by the contract of `Pin::new_unchecked`. ### Method `as_ref` ``` -------------------------------- ### From> Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Allows conversion from a Box to a Pin>. ```APIDOC ## fn from(boxed: Box) -> Pin> ### Description Converts a `Box` into a `Pin>`. If `T` does not implement `Unpin`, then `*boxed` will be pinned in memory and unable to be moved. This conversion does not allocate on the heap and happens in place. This is also available via `Box::into_pin`. Constructing and pinning a `Box` with `>>::from(Box::new(x))` can also be written more concisely using `Box::pin(x)`. This `From` implementation is useful if you already have a `Box`, or you are constructing a (pinned) `Box` in a different way than with `Box::new`. ### Method `from` ``` -------------------------------- ### PartialEq Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides equality comparison for Pin and Pin. ```APIDOC ## fn eq(&self, other: &Pin) -> bool ### Description Tests for `self` and `other` values to be equal, and is used by `==`. ### Method `eq` ``` ```APIDOC ## fn ne(&self, other: &Pin) -> bool ### Description Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. ### Method `ne` ``` -------------------------------- ### Get Encoded Length of WriteRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.WriteRequest.html Returns the encoded length of the WriteRequest message without a length delimiter. This is part of the Message trait. ```rust fn encoded_len(&self) -> usize ``` -------------------------------- ### Initialization and Memory Management Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.AddServerRequest.html Provides functions for initializing objects, dereferencing pointers, and managing memory. ```APIDOC ## Initialization and Memory Management ### `init(init: ::Init) -> usize` Initializes an object of type `T` with the given initializer and returns a pointer to the initialized object. ### `deref<'a>(ptr: usize) -> &'a T` Dereferences a raw pointer to safely obtain an immutable reference to the object. ### `deref_mut<'a>(ptr: usize) -> &'a mut T` Mutably dereferences a raw pointer to safely obtain a mutable reference to the object. ### `drop(ptr: usize)` Drops the object pointed to by the given pointer, releasing its resources. ``` -------------------------------- ### Pointable::deref_mut() Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Ballot.html Mutably dereferences the given pointer to get a mutable reference. This is an unsafe function as part of the Pointable trait. ```rust unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T ``` -------------------------------- ### Display Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides a way to format a Pin for display. ```APIDOC ## fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> ### Description Formats the value using the given formatter. ### Method `fmt` ``` -------------------------------- ### Pin::as_mut Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Gets a mutable reference to the pinned value this `Pin` points to. This is useful when doing multiple calls to functions that consume the pinning pointer. ```APIDOC ## pub fn as_mut(&mut self) -> Pin<&mut ::Target> ### Description Gets a mutable reference to the pinned value this `Pin` points to. This is a generic method to go from `&mut Pin>` to `Pin<&mut T>`. It is safe because, as part of the contract of `Pin::new_unchecked`, the pointee cannot move after `Pin>` got created. “Malicious” implementations of `Pointer::DerefMut` are likewise ruled out by the contract of `Pin::new_unchecked`. This method is useful when doing multiple calls to functions that consume the pinning pointer. ### Method `as_mut` ### Example ```rust use std::pin::Pin; impl Type { fn method(self: Pin<&mut Self>) { // do something } fn call_method_twice(mut self: Pin<&mut Self>) { // `method` consumes `self`, so reborrow the `Pin<&mut Self>` via `as_mut`. self.as_mut().method(); self.as_mut().method(); } } ``` ``` -------------------------------- ### PartialOrd Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides partial ordering comparison for Pin and Pin. ```APIDOC ## fn partial_cmp(&self, other: &Pin) -> Option ### Description This method returns an ordering between `self` and `other` values if one exists. ### Method `partial_cmp` ``` ```APIDOC ## fn lt(&self, other: &Pin) -> bool ### Description Tests less than (for `self` and `other`) and is used by the `<` operator. ### Method `lt` ``` ```APIDOC ## fn le(&self, other: &Pin) -> bool ### Description Tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. ### Method `le` ``` ```APIDOC ## fn gt(&self, other: &Pin) -> bool ### Description Tests greater than (for `self` and `other`) and is used by the `>` operator. ### Method `gt` ``` ```APIDOC ## fn ge(&self, other: &Pin) -> bool ### Description Tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. ### Method `ge` ``` -------------------------------- ### Unwrapping a Pin to Get the Inner Pointer Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Safely unwraps a `Pin` to return the underlying `Ptr`. This operation is unsafe because it bypasses the pinning guarantees. ```rust pub const unsafe fn into_inner_unchecked(pin: Pin) -> Ptr ``` -------------------------------- ### Unwrap Pin to Get Inner Pointer Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Unwraps a `Pin` to retrieve the underlying pointer. This is safe when the data pointed to implements `Unpin`, allowing the pinning invariants to be ignored. ```rust use std::pin::Pin; let mut val: u8 = 5; let pinned: Pin<&mut u8> = Pin::new(&mut val); // Unwrap the pin to get the underlying mutable reference to the value. We can do // this because `val` doesn't care about being moved, so the `Pin` was just // a "facade" anyway. let r = Pin::into_inner(pinned); assert_eq!(*r, 5); ``` -------------------------------- ### TryInto Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.TimeoutNow.html Provides a fallible conversion from one type to another. ```APIDOC ## fn try_into(self) -> Result>::Error> ### Description Performs the conversion from type T to type U. ### Returns - Result>::Error> - Ok(U) if the conversion is successful, or Err(Error) if it fails. ``` -------------------------------- ### TryFrom Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.TimeoutNow.html Provides a fallible conversion from one type to another. ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion from type U to type T. ### Parameters #### Path Parameters - **value** (U) - Required - The value to convert. ### Returns - Result>::Error> - Ok(T) if the conversion is successful, or Err(Error) if it fails. ``` -------------------------------- ### Getting a Shared Reference to a Pinned Value Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Obtains a shared reference (`Pin<&T>`) to the value pointed to by a `Pin` pointer. This is safe due to the pinning contract ensuring the value does not move. ```rust pub fn as_ref(&self) -> Pin<&::Target> where Ptr: Deref ``` -------------------------------- ### Get Latest Snapshot Index Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftApp.html Retrieves the index of the most recent snapshot in the store. If this index is greater than the current snapshot entry index, it will be used to replace the existing snapshot entry. ```rust fn get_latest_snapshot<'life0, 'async_trait>( &'life0 self, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### vzip Method Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Clock.html Zips multiple lanes together. ```APIDOC ### impl VZip for T where V: MultiLane, #### fn vzip(self) -> V ``` -------------------------------- ### Ord Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides ordering capabilities for Pin. ```APIDOC ## fn cmp(&self, other: &Pin) -> Ordering ### Description This method returns an `Ordering` between `self` and `other`. ### Method `cmp` ``` ```APIDOC ## fn max(self, other: Self) -> Self where Self: Sized, ### Description Compares and returns the maximum of two values. ### Method `max` ``` ```APIDOC ## fn min(self, other: Self) -> Self where Self: Sized, ### Description Compares and returns the minimum of two values. ### Method `min` ``` ```APIDOC ## fn clamp(self, min: Self, max: Self) -> Self where Self: Sized, ### Description Restrict a value to a certain interval. ### Method `clamp` ``` -------------------------------- ### CloneToUninit::clone_to_uninit() Implementation for T Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Ballot.html Performs copy-assignment from self to a raw pointer destination. This is a nightly-only experimental API. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### Pin::set Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Assigns a new value to the memory location pointed to by the `Pin`. This overwrites pinned data, but the original pinned value's destructor gets run before being overwritten. ```APIDOC ## pub fn set(&mut self, value: ::Target) ### Description Assigns a new value to the memory location pointed to by the `Pin`. This overwrites pinned data, but that is okay: the original pinned value’s destructor gets run before being overwritten and the new value is also a valid value of the same type, so no pinning invariant is violated. See the `pin` module documentation for more information on how this upholds the pinning invariants. ### Method `set` ### Parameters #### Request Body - **value** (::Target) - Required - The new value to assign. ### Request Example ```rust use std::pin::Pin; let mut val: u8 = 5; let mut pinned: Pin<&mut u8> = Pin::new(&mut val); println!("{}", pinned); // 5 pinned.set(10); println!("{}", pinned); // 10 ``` ``` -------------------------------- ### Create a Raft service Source: https://docs.rs/lolraft/0.10.2/lolraft/raft_service/fn.new.html Creates a Raft service backed by a `RaftNode`. This function is used to initialize a new Raft server. ```rust pub fn new(node: RaftNode) -> RaftServer ``` -------------------------------- ### Getting a Nested Mutable Reference from a Pin Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Retrieves a `Pin<&mut T>` from a nested `Pin` pointer (`Pin<&mut Pin>`). This is safe because the outer `Pin` guarantees the inner pointee cannot move. ```rust pub fn as_deref_mut( self: Pin<&mut Pin>, ) -> Pin<&mut ::Target> where Ptr: DerefMut ``` -------------------------------- ### TryFrom and TryInto Conversions Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Entry.html Methods for attempting conversions that may fail, returning a `Result`. ```rust type Error = Infallible ``` ```rust fn try_from(value: U) -> Result>::Error> ``` ```rust type Error = >::Error ``` ```rust fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Sink Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Allows Pin

to be used as a Sink. ```APIDOC ## fn poll_ready( self: Pin<&mut Pin

>, cx: &mut Context<'_>, ) -> Poll as Sink>::Error>> ### Description Attempts to prepare the `Sink` to receive a value. ### Method `poll_ready` ``` ```APIDOC ## fn start_send( self: Pin<&mut Pin

>, item: Item, ) -> Result<(), as Sink>::Error> ### Description Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to `poll_ready` which returned `Poll::Ready(Ok(()))`. ### Method `start_send` ``` -------------------------------- ### Getting a Mutable Reference to a Pinned Value Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Obtains a mutable reference (`Pin<&mut T>`) to the value pointed to by a `Pin` pointer. This is useful for multiple calls to functions that consume the pinning pointer, reborrowing via `as_mut`. ```rust pub fn as_mut(&mut self) -> Pin<&mut ::Target> where Ptr: DerefMut ``` -------------------------------- ### VZip Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.TimeoutNow.html Zips multiple lanes of data together. ```APIDOC ## fn vzip(self) -> V ### Description Zips the lanes of data together. ### Returns - V - The zipped data. ``` -------------------------------- ### RaftProcess::new Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.RaftProcess.html Constructs a new RaftProcess instance. This function takes several components required for the Raft algorithm's operation, including an application trait, log store, ballot store, and a driver for managing state transitions and communication. ```APIDOC ## RaftProcess::new ### Description Constructs a new `RaftProcess` instance. This function takes several components required for the Raft algorithm's operation, including an application trait, log store, ballot store, and a driver for managing state transitions and communication. ### Signature ```rust pub async fn new( app: impl RaftApp, log_store: impl RaftLogStore, ballot_store: impl RaftBallotStore, driver: RaftDriver, ) -> Result ``` ### Parameters * `app`: An implementation of the `RaftApp` trait, representing the application's state and logic. * `log_store`: An implementation of the `RaftLogStore` trait, responsible for persisting the Raft log. * `ballot_store`: An implementation of the `RaftBallotStore` trait, responsible for persisting ballot information (like current term and voted for). * `driver`: An implementation of the `RaftDriver` trait, which handles the driving of the Raft state machine and network communication. ``` -------------------------------- ### PartialEq Implementation for AddServerRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.AddServerRequest.html Enables comparison for equality and inequality between AddServerRequest instances. ```rust fn eq(&self, other: &AddServerRequest) -> bool ``` ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### TryFrom and TryInto Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.Response.html Provides methods for fallible conversions between types. ```APIDOC ## type Error = Infallible ### Description The type returned in the event of a conversion error. ### Type Alias type ``` ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ### Method fn ``` ```APIDOC ## type Error = >::Error ### Description The type returned in the event of a conversion error. ### Type Alias type ``` ```APIDOC ## fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ### Method fn ``` -------------------------------- ### From and Into Conversions Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Entry.html Standard conversions for creating a type from itself or another type that can be converted into it. ```rust fn from(t: T) -> T ``` ```rust fn from_ref(input: &T) -> T ``` ```rust fn into(self) -> U ``` -------------------------------- ### Ownership and Cloning Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.AddServerRequest.html Details methods for creating owned data from borrowed data and cloning into existing data. ```APIDOC ## Ownership and Cloning ### `to_owned(&self) -> T` Creates owned data from borrowed data, typically by cloning. This is part of the `ToOwned` trait implementation. ### `clone_into(&self, target: &mut T)` Uses borrowed data to replace the contents of owned data, usually by cloning. This is part of the `ToOwned` trait implementation. ``` -------------------------------- ### Hash Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides hashing capabilities for Pin. ```APIDOC ## fn hash(&self, state: &mut H) where H: Hasher, ### Description Feeds this value into the given `Hasher`. ### Method `hash` ``` ```APIDOC ## fn hash_slice(data: &[Self], state: &mut H) where H: Hasher, Self: Sized, ### Description Feeds a slice of this type into the given `Hasher`. ### Method `hash_slice` ``` -------------------------------- ### Pointer Operations Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.RemoveServerRequest.html Provides functions for managing raw pointers, including initialization, dereferencing, and dropping. ```APIDOC ## unsafe fn init(init: ::Init) -> usize ### Description Initializes a with the given initializer. ### Method unsafe fn init ### Parameters - **init** (::Init) - Required - The initializer for the object. ### Returns - usize - The pointer to the initialized object. ``` ```APIDOC ## unsafe fn deref<'a>(ptr: usize) -> &'a T ### Description Dereferences the given pointer to provide an immutable reference. ### Method unsafe fn deref ### Parameters - **ptr** (usize) - Required - The pointer to dereference. ### Returns - &'a T - An immutable reference to the object at the pointer. ``` ```APIDOC ## unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T ### Description Mutably dereferences the given pointer to provide a mutable reference. ### Method unsafe fn deref_mut ### Parameters - **ptr** (usize) - Required - The pointer to mutably dereference. ### Returns - &'a mut T - A mutable reference to the object at the pointer. ``` ```APIDOC ## unsafe fn drop(ptr: usize) ### Description Drops the object pointed to by the given pointer, freeing associated resources. ### Method unsafe fn drop ### Parameters - **ptr** (usize) - Required - The pointer to the object to drop. ``` -------------------------------- ### Future Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Allows Pin

to be used as a Future. ```APIDOC ## fn poll( self: Pin<&mut Pin

>, cx: &mut Context<'_>, ) -> Poll< as Future>::Output> ### Description Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. ### Method `poll` ``` -------------------------------- ### AddServerRequest Struct Definition Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.AddServerRequest.html Defines the structure for adding a server, including the lane ID and server ID. ```rust pub struct AddServerRequest { pub lane_id: u32, pub server_id: String, } ``` -------------------------------- ### Body Implementation for Pin

Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Defines the behavior of Pin

as a data stream body, including data polling, trailer handling, and stream properties. ```APIDOC ## Body for Pin

### Description Defines the behavior of Pin

as a data stream body, including data polling, trailer handling, and stream properties. ### Associated Types #### `Data` Values yielded by the `Body`. #### `Error` The error type this `Body` might generate. ### Methods #### `poll_data` Attempt to pull out the next data buffer of this stream. #### `poll_trailers` Poll for an optional **single** `HeaderMap` of trailers. #### `is_end_stream` Returns `true` when the end of stream has been reached. #### `size_hint` Returns the bounds on the remaining length of the stream. #### `data` Returns future that resolves to next data chunk, if any. #### `trailers` Returns future that resolves to trailers, if any. #### `map_data` Maps this body’s data value to a different value. #### `map_err` Maps this body’s error value to a different value. #### `collect` Turn this body into `Collected` body which will collect all the DATA frames and trailers. #### `boxed` Turn this body into a boxed trait object. #### `boxed_unsync` Turn this body into a boxed trait object that is !Sync. ``` -------------------------------- ### Default Implementation for Pin> Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides a default value for Pin> if the inner Box implements Default. ```APIDOC ## Default for Pin> ### Description Provides a default value for Pin> if the inner Box implements Default. ### Methods #### `default` Returns the “default value” for a type. ``` -------------------------------- ### RaftProcess Constructor Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.RaftProcess.html Asynchronous function to create a new RaftProcess instance. It requires implementations of RaftApp, RaftLogStore, RaftBallotStore, and a RaftDriver. ```rust pub async fn new( app: impl RaftApp, log_store: impl RaftLogStore, ballot_store: impl RaftBallotStore, driver: RaftDriver, ) -> Result ``` -------------------------------- ### TimeoutNow Initialization Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.TimeoutNow.html Initializes a TimeoutNow object with the provided initializer. ```APIDOC ## unsafe fn init(init: ::Init) -> usize ### Description Initializes a with the given initializer. ### Parameters #### Path Parameters - **init** (::Init) - Required - The initializer for the object. ### Returns - usize - The pointer to the initialized object. ``` -------------------------------- ### NodeId Initialization Source: https://docs.rs/lolraft/0.10.2/lolraft/struct.NodeId.html Initializes a NodeId with the given initializer. This is an unsafe operation. ```APIDOC ## unsafe fn init ### Description Initializes a with the given initializer. ### Signature `unsafe fn init(init: ::Init) -> usize` ``` -------------------------------- ### Clone Implementation for Entry Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Entry.html Provides methods to create a duplicate of an Entry or copy from another Entry. ```rust fn clone(&self) -> Entry ``` ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### Ownership and Cloning Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.RemoveServerRequest.html Methods for creating owned data from borrowed data and cloning data into existing mutable references. ```APIDOC ## fn to_owned(&self) -> T ### Description Creates owned data from borrowed data, usually by cloning. ### Method fn to_owned ### Returns - T - The owned data. ``` ```APIDOC ## fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method fn clone_into ### Parameters - **target** (&mut T) - Required - A mutable reference to the owned data to be updated. ``` -------------------------------- ### Type Conversion Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.AddServerRequest.html Enables type conversions using `TryFrom` and `TryInto` traits. ```APIDOC ## Type Conversion ### `try_from(value: U) -> Result>::Error>` Performs a fallible conversion from type `U` to type `T`. This is part of the `TryFrom` trait implementation. ### `try_into(self) -> Result>::Error>` Performs a fallible conversion from type `T` to type `U`. This is part of the `TryInto` trait implementation. ``` -------------------------------- ### Pointable::init() Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Ballot.html Initializes a with the given initializer. This is an unsafe function as part of the Pointable trait. ```rust unsafe fn init(init: ::Init) -> usize ``` -------------------------------- ### Sink Operations for Pin

Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides methods for interacting with a sink wrapped in Pin

. ```APIDOC ## Sink Operations for Pin

### Description Implementation of the Sink trait for Pin

. ### Methods #### poll_flush ```rust fn poll_flush( self: Pin<&mut Pin

>, cx: &mut Context<'_>, ) -> Poll as Sink>::Error>> ``` Flush any remaining output from this sink. #### poll_close ```rust fn poll_close( self: Pin<&mut Pin

>, cx: &mut Context<'_>, ) -> Poll as Sink>::Error>> ``` Flush any remaining output and close this sink, if necessary. ``` -------------------------------- ### Insert Entry into RaftLogStore Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftLogStore.html Asynchronously inserts a log entry at a specific index. Ensure the index and entry are valid before calling. ```rust fn insert_entry<'life0, 'async_trait>( &'life0 self, i: Index, e: Entry, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### Create New RaftNode Source: https://docs.rs/lolraft/0.10.2/lolraft/struct.RaftNode.html Instantiates a new Raft node with a unique identifier. Use this to initialize a Raft node in the system. ```rust pub fn new(id: NodeId) -> Self ``` -------------------------------- ### AsyncSeek for Pin

Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides asynchronous seeking capabilities for a pinned type. ```APIDOC ## impl

AsyncSeek for Pin

where P: DerefMut + Unpin,

::Target: AsyncSeek, ### fn poll_seek( self: Pin<&mut Pin

>, cx: &mut Context<'_>, pos: SeekFrom, ) -> Poll> Attempt to seek to an offset, in bytes, in a stream. Read more ``` ```APIDOC ## impl

AsyncSeek for Pin

where P: DerefMut,

::Target: AsyncSeek, ### fn start_seek(self: Pin<&mut Pin

>, pos: SeekFrom) -> Result<(), Error> Attempts to seek to an offset, in bytes, in a stream. Read more ### fn poll_complete( self: Pin<&mut Pin

>, cx: &mut Context<'_>, ) -> Poll> Waits for a seek operation to complete. Read more ``` -------------------------------- ### Process Write Request Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftApp.html Applies a write request to the application state. This method may change the application's state. ```rust fn process_write<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 [u8], entry_index: Index, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; ``` -------------------------------- ### get_entry Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftLogStore.html Retrieves an entry from the log at a specific index. ```APIDOC ## get_entry ### Description Get the entry at index `i` from the log. ### Method `get_entry` ### Parameters - `i` (Index) - The index of the entry to retrieve. ### Returns A `Future` that resolves to a `Result>`. `Some(Entry)` if found, `None` if not found, or an error. ``` -------------------------------- ### Open Snapshot Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftApp.html Reads an existing snapshot from the store by its index. Used when a follower requests a snapshot from the leader. ```rust fn open_snapshot<'life0, 'async_trait>( &'life0 self, snapshot_index: Index, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; ``` -------------------------------- ### StructuralPartialEq Implementation for AddServerRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.AddServerRequest.html Indicates that AddServerRequest supports structural partial equality comparisons. ```rust impl StructuralPartialEq for AddServerRequest ``` -------------------------------- ### Implement PartialEq for ReadRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.ReadRequest.html Enables comparison for equality and inequality between ReadRequest instances. ```rust fn eq(&self, other: &ReadRequest) -> bool ``` ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### Default Implementation for RemoveServerRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.RemoveServerRequest.html Provides a default value for RemoveServerRequest, useful for initialization. ```rust fn default() -> Self ``` -------------------------------- ### TryInto Trait Implementation Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.WriteRequest.html Provides a convenient way to attempt conversion into another type, leveraging TryFrom. ```APIDOC ## type Error = >::Error ### Description The type returned in the event of a conversion error. ## fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ``` -------------------------------- ### AsyncWrite Implementation for Pin

Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides methods for asynchronous writing operations on a pinned mutable reference. ```APIDOC ## AsyncWrite for Pin

### Description Provides methods for asynchronous writing operations on a pinned mutable reference. ### Methods #### `poll_write` Attempt to write bytes from `buf` into the object. #### `poll_write_vectored` Like `poll_write`, except that it writes from a slice of buffers. #### `is_write_vectored` Determines if this writer has an efficient `poll_write_vectored` implementation. #### `poll_flush` Attempts to flush the object, ensuring that any buffered data reach their destination. #### `poll_shutdown` Initiates or attempts to shut down this writer, returning success when the I/O connection has completely shut down. ``` -------------------------------- ### VZip Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.Response.html Provides a method for zipping with a multi-lane type. ```APIDOC ## fn vzip(self) -> V ### Description Zips the current type with a multi-lane type. ### Method fn ``` -------------------------------- ### Clone Implementation for AddServerRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.AddServerRequest.html Provides methods to create a duplicate or copy-assign values of AddServerRequest. ```rust fn clone(&self) -> AddServerRequest ``` ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### AsyncWrite for Pin

Source: https://docs.rs/lolraft/0.10.2/lolraft/process/type.SnapshotStream.html Provides asynchronous writing capabilities for a pinned type. ```APIDOC ## impl

AsyncWrite for Pin

where P: DerefMut + Unpin,

::Target: AsyncWrite, ### fn poll_write( self: Pin<&mut Pin

>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll> Attempt to write bytes from `buf` into the object. Read more ### fn poll_write_vectored( self: Pin<&mut Pin

>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll> Attempt to write bytes from `bufs` into the object using vectored IO operations. Read more ### fn poll_flush( self: Pin<&mut Pin

>, cx: &mut Context<'_>, ) -> Poll> Attempt to flush the object, ensuring that any buffered data reach their destination. Read more ### fn poll_close( self: Pin<&mut Pin

>, cx: &mut Context<'_>, ) -> Poll> Attempt to close the object. Read more ``` -------------------------------- ### try_into Method Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Clock.html Performs a conversion operation that may result in an error. ```APIDOC #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### StructuralPartialEq Implementation for RemoveServerRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.RemoveServerRequest.html Indicates structural partial equality for RemoveServerRequest. -------------------------------- ### PartialEq Implementation for RemoveServerRequest Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.RemoveServerRequest.html Enables comparison for equality between RemoveServerRequest instances. ```rust fn eq(&self, other: &RemoveServerRequest) -> bool ``` ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### open_snapshot Source: https://docs.rs/lolraft/0.10.2/lolraft/process/trait.RaftApp.html Retrieve an existing snapshot from the snapshot store using its index. This is used when a follower requests a snapshot from the leader. ```APIDOC ## open_snapshot ### Description Read existing snapshot with index `snapshot_index` from the snapshot store. This function is called when a follower requests a snapshot from the leader. ### Method Signature `fn open_snapshot<'life0, 'async_trait>( &'life0 self, snapshot_index: Index, ) -> Pin> + Send + 'async_trait>>` ### Parameters * `snapshot_index` (Index) - The index of the snapshot to retrieve. ### Type Constraints `where Self: 'async_trait, 'life0: 'async_trait` ``` -------------------------------- ### RaftNode::new Source: https://docs.rs/lolraft/0.10.2/lolraft/struct.RaftNode.html Creates a new Raft node with a unique identifier. ```APIDOC ## RaftNode::new ### Description Create a new Raft node with a given node ID. ### Signature ```rust pub fn new(id: NodeId) -> Self ``` ``` -------------------------------- ### Ownership and Conversion Source: https://docs.rs/lolraft/0.10.2/lolraft/client/struct.ReadRequest.html Methods related to owning data, cloning, and type conversions. ```APIDOC ### impl ToOwned for T where T: Clone, #### type Owned = T ### Description The resulting type after obtaining ownership. #### fn to_owned(&self) -> T ### Description Creates owned data from borrowed data, usually by cloning. ### Method fn to_owned ### Parameters #### Path Parameters - **self** (&self) - Required - The borrowed data. ### Response #### Success Response (T) - **T** - The owned data. #### fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method fn clone_into ### Parameters #### Path Parameters - **self** (&self) - Required - The borrowed data. - **target** (&mut T) - Required - The mutable reference to the owned data to be replaced. ### Response #### Success Response () ### impl TryFrom for T where U: Into, #### type Error = Infallible ### Description The type returned in the event of a conversion error. #### fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ### Method fn try_from ### Parameters #### Path Parameters - **value** (U) - Required - The value to convert. ### Response #### Success Response (Result>::Error>) - **Result>::Error>** - The result of the conversion. ### impl TryInto for T where U: TryFrom, #### type Error = >::Error ### Description The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ### Method fn try_into ### Parameters #### Path Parameters - **self** (self) - Required - The value to convert. ### Response #### Success Response (Result>::Error>) - **Result>::Error>** - The result of the conversion. ``` -------------------------------- ### with_subscriber Method Source: https://docs.rs/lolraft/0.10.2/lolraft/process/struct.Clock.html Attaches a subscriber to the type, returning a wrapper. ```APIDOC ### impl WithSubscriber for T #### fn with_subscriber(self, subscriber: S) -> WithDispatch where S: Into, Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. Read more ```