Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
akorchyn committed Feb 6, 2025
1 parent 231a45b commit 695c873
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions near-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ extern crate quickcheck;
/// The attribute prepares a struct/enum to be a contract state.
/// **The attribute specific to the [near] macro only.**
///
/// This attribute will generate code to load and deserialize state if the `self` parameter is included
/// as well as saving it back to state if `&mut self` is used.
///
/// ### Basic example
/// ```rust
/// use near_sdk::near;
Expand All @@ -123,11 +120,6 @@ extern crate quickcheck;
/// pub struct Contract {
/// data: i8,
/// }
///
/// #[near]
/// impl Contract {
/// pub fn some_function(&self) {}
/// }
/// ```
///
/// ## `#[near(serializers=[...])` (annotates structs/enums)
Expand Down Expand Up @@ -195,7 +187,7 @@ extern crate quickcheck;
///
/// #[near]
/// impl Contract {
/// pub fn some_function(&self, #[serializer(borsh)] a: String, #[serializer(borsh)] b: String) {}
/// pub fn borsh_arguments(&self, #[serializer(borsh)] a: String, #[serializer(borsh)] b: String) {}
/// }
/// ```
///
Expand Down Expand Up @@ -300,36 +292,12 @@ extern crate quickcheck;
/// #[near]
/// impl MyContract {
/// #[result_serializer(borsh)]
/// pub fn borsh_parameters(&self) -> String {
/// pub fn borsh_return_value(&self) -> String {
/// "hello_world".to_string()
/// }
/// }
/// ```
///
/// `#[near]` will handle serializing and setting the return value of the
/// function execution based on what type is returned by the function. By default, this will be
/// done through `serde` serialized as JSON, but this can be overridden using
/// `#[result_serializer(borsh)]`:
///
/// ### Basic example
///
/// ```rust
/// use near_sdk::near;
///
/// # #[near(contract_state)]
/// # struct MyContract {
/// # pub name: String,
/// # }
///
/// #[near]
/// impl MyContract {
/// #[result_serializer(borsh)]
/// pub fn borsh_parameters(&self) -> String {
/// self.name.clone()
/// }
/// }
/// ```
///
/// ## `#[handle_result]` (annotates methods of a type in its `impl` block)
///
/// Have `#[handle_result]` to Support Result types regardless of how they're referred to
Expand Down

0 comments on commit 695c873

Please sign in to comment.