LensClient

Struct LensClient 

Source
pub struct LensClient {
    pub queries: Queries,
    pub endpoint: String,
    pub chain: Chain,
    pub net: Net,
    pub access_token: Option<String>,
    pub refresh_token: Option<String>,
}

Fields§

§queries: Queries§endpoint: String§chain: Chain§net: Net§access_token: Option<String>§refresh_token: Option<String>

Implementations§

Source§

impl LensClient

Constructs a new LensClient

Source

pub fn new(chain: Chain, net: Net) -> LensClient

Create a new LensClient

§Arguments
  • chain - The chain of the Lens server
  • net - The net of the Lens server
§Return
  • LensClient - The new LensClient
Source

pub fn get_default_profile_by_address( &self, address: String, ) -> Result<Profile, String>

Get the profiles of a user by address

§Arguments
  • address - The address of the user
§Returns
  • Result<profile::default::Profile, String> - The default profile of the user
Source

pub fn get_profiles_by_address( &self, address: String, ) -> Result<AddressProfiles, String>

Get the profiles of a user by address

§Arguments
  • address - The address of the user
§Returns
  • Result<profile::AddressProfiles, String> - The profiles of the user
Source

pub fn does_follow( &self, address: String, followee: String, ) -> Result<DFollow, String>

Get status of follow of a address to a profile id

§Arguments
  • address - The address of the user
  • followee - The profile id of the followee
§Returns
  • Result<follow::DFollow, String> - The follow status of the user
Source

pub fn get_following( &self, address: String, limit: u64, ) -> Result<FollowingData, String>

Get the followees of a user by address

§Arguments
  • address - The address of the user
  • limit - The amount of the returned followees
§Returns
  • Result<follow::following::FollowingData, String> - The followees of the user
Source

pub fn get_followers( &self, profile_id: String, limit: u64, ) -> Result<FollowersData, String>

Get the followers of a user by address

§Arguments
  • profile_id - The profile id of the user
  • limit - The amount of the returned followers
§Returns
  • Result<follow::followers::FollowersData, String> - The followers of the user
Source

pub fn challenge(&self, address: String) -> Result<AuthChallenge, String>

Retrieve the callenge to sign to login to Lens

§Arguments
  • address - The address of the user
§Returns
  • Result<auth::challenge::Challenge, String> - The challenge to sign to login to Lens
Source

pub fn login( &mut self, address: String, signature: String, ) -> Result<Login, String>

Sign to login to Lens

§Arguments
  • address - The address of the user
  • signature - The signature of the challenge to login to Lens
§Returns
  • Result<auth::login::Login, String> - The auth token to login to Lens
Source

pub fn create_profile( &self, handle: String, ) -> Result<CreateProfileData, String>

Create a Lens profile

§Arguments
  • handle - The handle of the user
§Returns
  • Result<crate::lens::profile::create::CreateProfileData, String> - Data with transaction hash of profile creation
Source

pub fn make_request( &self, q: Query, headers: Option<Vec<Value>>, ) -> Result<Response, Option<String>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,