AElf.CSharp.Core
Contents
Builder type
Namespace
AElf.CSharp.Core.ServerServiceDefinition
Summary
Builder class for ServerServiceDefinition.
ctor() constructor
Summary
Creates a new instance of builder.
Parameters
This constructor has no parameters.
AddMethod``2(method,handler) method
Summary
Adds a definition for a single request - single response method.
Returns
This builder instance.
Parameters
Name |
Type |
Description |
---|---|---|
method |
The method. |
|
handler |
The method handler. |
Generic Types
Name |
Description |
---|---|
TRequest |
The request message class. |
TResponse |
The response message class. |
Build() method
Summary
Creates an immutable ServerServiceDefinition
from this builder.
Returns
The ServerServiceDefinition
object.
Parameters
This method has no parameters.
EncodingHelper type
Namespace
AElf.CSharp.Core.Utils
Summary
Helper class for serializing strings.
EncodeUtf8(str) method
Summary
Serializes a UTF-8 string to a byte array.
Returns
the serialized string.
Parameters
Name |
Type |
Description |
---|---|---|
str |
IMethod type
Namespace
AElf.CSharp.Core
Summary
A non-generic representation of a remote method.
FullName property
Summary
Gets the fully qualified name of the method. On the server side, methods are dispatched based on this name.
Name property
Summary
Gets the unqualified name of the method.
ServiceName property
Summary
Gets the name of the service to which this method belongs.
Type property
Summary
Gets the type of the method.
Marshaller type
Namespace
AElf.CSharp.Core
Summary
Encapsulates the logic for serializing and deserializing messages.
ctor(serializer,deserializer) constructor
Summary
Initializes a new marshaller from simple serialize/deserialize functions.
Parameters
Name |
Type |
Description |
---|---|---|
serializer |
Function that will be used to deserialize messages. |
Deserializer property
Summary
Gets the deserializer function.
Serializer property
Summary
Gets the serializer function.
Marshallers type
Namespace
AElf.CSharp.Core
Summary
Utilities for creating marshallers.
StringMarshaller property
Summary
Returns a marshaller for string
type. This is useful for testing.
Create() method
Summary
Creates a marshaller from specified serializer and deserializer.
Parameters
This method has no parameters.
MethodType type
Namespace
AElf.CSharp.Core
Action constants
Summary
The method modifies the contrac state.
View constants
Summary
The method doesn’t modify the contract state.
Method type
Namespace
AElf.CSharp.Core
Summary
A description of a remote method.
Generic Types
Name |
Description |
---|---|
TRequest |
Request message type for this method. |
TResponse |
Response message type for this method. |
ctor(type,serviceName,name,requestMarshaller,responseMarshaller) constructor
Summary
Initializes a new instance of the Method
class.
Parameters
Name |
Type |
Description |
---|---|---|
type |
Type of method. |
|
serviceName |
Name of service this method belongs to. |
|
name |
Unqualified name of the method. |
|
request Marshaller |
Marshaller used for request messages. |
|
response Marshaller |
Marshaller used for response messages. |
FullName property
Summary
Gets the fully qualified name of the method. On the server side, methods are dispatched based on this name.
Name property
Summary
Gets the unqualified name of the method.
RequestMarshaller property
Summary
Gets the marshaller used for request messages.
ResponseMarshaller property
Summary
Gets the marshaller used for response messages.
ServiceName property
Summary
Gets the name of the service to which this method belongs.
Type property
Summary
Gets the type of the method.
GetFullName() method
Summary
Gets full name of the method including the service name.
Parameters
This method has no parameters.
Preconditions type
Namespace
AElf.CSharp.Core.Utils
CheckNotNull(reference) method
Summary
Throws ArgumentNullException if reference is null.
Parameters
Name |
Type |
Description |
---|---|---|
reference |
The reference. |
CheckNotNull(reference,paramName) method
Summary
Throws ArgumentNullException if reference is null.
Parameters
Name |
Type |
Description |
---|---|---|
reference |
The reference. |
|
paramName |
The parameter name. |
SafeMath type
Namespace
AElf.CSharp.Core
Summary
Helper methods for safe math operations that explicitly check for overflow.
ServerServiceDefinition type
Namespace
AElf.CSharp.Core
Summary
Stores mapping of methods to server call handlers. Normally, the
ServerServiceDefinition
objects will be created by the
BindService
factory method that is part of the autogenerated code
for a protocol buffers service definition.
BindService() method
Summary
Forwards all the previously stored AddMethod
calls to the service
binder.
Parameters
This method has no parameters.
CreateBuilder() method
Summary
Creates a new builder object for ServerServiceDefinition
.
Returns
The builder object.
Parameters
This method has no parameters.
ServiceBinderBase type
Namespace
AElf.CSharp.Core
Summary
Allows binding server-side method implementations in alternative serving
stacks. Instances of this class are usually populated by the
BindService
method that is part of the autogenerated code for a
protocol buffers service definition.
AddMethod(method,handler) method
Summary
Adds a definition for a single request - single response method.
Parameters
Name |
Type |
Description |
---|---|---|
method |
The method. |
|
handler |
The method handler. |
Generic Types
Name |
Description |
---|---|
TRequest |
The request message class. |
TResponse |
The response message class. |
TimestampExtensions type
Namespace
AElf.CSharp.Core.Extension
Summary
Helper methods for dealing with protobuf timestamps.
AddDays(timestamp,days) method
Summary
Adds a given amount of days to a timestamp. Returns a new instance.
Returns
a new timestamp instance.
Parameters
Name |
Type |
Description |
---|---|---|
timestamp |
Google.Protobuf.WellKnown Types.Timestamp |
the timestamp. |
days |
the amount of days. |
AddHours(timestamp,hours) method
Summary
Adds a given amount of hours to a timestamp. Returns a new instance.
Returns
a new timestamp instance.
Parameters
Name |
Type |
Description |
---|---|---|
timestamp |
Google.Protobuf .WellKnownTypes.Timestamp |
the timestamp. |
hours |
the amount of hours. |
AddMilliseconds(timestamp,milliseconds) method
Summary
Adds a given amount of milliseconds to a timestamp. Returns a new instance.
Returns
a new timestamp instance.
Parameters
Name |
Type |
Description |
---|---|---|
timestamp |
Google.Protobuf. WellKnownTypes.Timestamp |
the timestamp. |
milliseconds |
the amount of milliseconds to add. |
AddMinutes(timestamp,minutes) method
Summary
Adds a given amount of minutes to a timestamp. Returns a new instance.
Returns
a new timestamp instance.
Parameters
Name |
Type |
Description |
---|---|---|
timestamp |
Google.Protobuf .WellKnownTypes.Timestamp |
the timestamp. |
minutes |
the amount of minutes. |
AddSeconds(timestamp,seconds) method
Summary
Adds a given amount of seconds to a timestamp. Returns a new instance.
Returns
a new timestamp instance.
Parameters
Name |
Type |
Description |
---|---|---|
timestamp |
Google.Protobuf .WellKnownTypes.Timestam |
the timestamp. |
seconds |
the amount of seconds. |
Max(timestamp1,timestamp2) method
Summary
Compares two timestamps and returns the greater one.
Returns
the greater timestamp.
Parameters
Name |
Type |
Description |
---|---|---|
timestamp1 |
Google.Protobuf .WellKnownTypes.Timestamp |
the first timestamp |
timestamp2 |
Google.Protobuf .WellKnownTypes.Timestamp |
the second timestamp |
Milliseconds(duration) method
Summary
Converts a protobuf duration to long.
Returns
the duration represented with a long.
Parameters
Name |
Type |
Description |
---|---|---|
duration |
Google.Protobuf. WellKnownTypes.Duration |
the duration to convert. |
UnaryServerMethod type
Namespace
AElf.CSharp.Core
Summary
Handler for a contract method.
Generic Types
Name |
Description |
---|---|
TRequest |
Request message type for this method. |
TResponse |
Response message type for this method. |