Skip to main content

InetSocketAddress

Struct InetSocketAddress 

Source
pub struct InetSocketAddress(/* private fields */);
Expand description

java.net.InetSocketAddress

Implementations§

Source§

impl InetSocketAddress

Source

pub fn as_socket_address(&self, e: &mut Env<'_>) -> SocketAddress

Downcast self to SocketAddress

Source

pub fn from_socket_address(e: &mut Env<'_>, addr: SocketAddress) -> Self

Upcast SocketAddress to self

Source

pub fn new_wildcard_address(e: &mut Env<'_>, port: i32) -> Self

Create a new socket address, using the local wildcard address as the IP address

<https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/net/InetSocketAddress.html#(int)>

Source

pub fn new_resolved(e: &mut Env<'_>, host: impl ToString, port: i32) -> Self

Create a new socket address, resolving the hostname to an IP address (unless the string is an IP literal)

https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/net/InetSocketAddress.html#%3Cinit%3E(java.lang.String,int)

Source

pub fn new(e: &mut Env<'_>, addr: InetAddress, port: i32) -> Self

Create a new socket address from a known IP and port

<https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/net/InetSocketAddress.html#(java.net.InetAddress,int)>

Source

pub fn address(&self, e: &mut Env<'_>) -> InetAddress

Get the IP address

Source

pub fn port(&self, e: &mut Env<'_>) -> u16

Get the port

Source

pub fn to_std(&self, e: &mut Env<'_>) -> SocketAddr

Convert InetSocketAddress to std::net::SocketAddr

Source

pub fn to_no_std(&self, e: &mut Env<'_>) -> SocketAddr

Convert InetSocketAddress to no_std_net::SocketAddr

Source

pub fn from_std(e: &mut Env<'_>, addr: SocketAddr) -> Self

Convert std::net::SocketAddr to InetSocketAddress

Source

pub fn from_no_std(e: &mut Env<'_>, addr: SocketAddr) -> Self

Convert std::net::SocketAddr to InetSocketAddress

Trait Implementations§

Source§

impl Class for InetSocketAddress

Source§

const PATH: &'static str = "java/net/InetSocketAddress"

The fully qualified java class path (slash-separated) Read more
Source§

impl Object for InetSocketAddress

Source§

fn upcast<'a, 'e>(_: &'a mut Env<'e>, jobj: Object) -> Self

Try to interpret an object as Self
Source§

fn downcast<'a, 'e>(self, _: &'a mut Env<'e>) -> Object

Create an object reference from self
Source§

fn downcast_ref<'a, 'e>(&'a self, e: &'a mut Env<'e>) -> Object

Create an object reference from &self
Source§

fn upcast_value_ref<'e>(e: &mut Env<'e>, jv: JValue<'e, '_>) -> Self
where Self: Sized,

Try to interpret a JValue as Self
Source§

fn upcast_value<'e>(e: &mut Env<'e>, jv: JValueOwned<'e>) -> Self
where Self: Sized,

Try to interpret a JValueOwned as Self
Source§

fn downcast_value<'e>(self, e: &mut Env<'e>) -> JValueOwned<'e>
where Self: Sized,

Create a JValueOwned from self
Source§

fn yield_to_java(&self, e: &mut Env<'_>) -> jobject

Use this to yield ownership of a java::lang::Object to the JVM, for example when returning a jobject from a native function.

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, 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<F, A, TF, T> Sequence<F, A, TF> for T

Source§

fn sequence<Ap>(self) -> <Ap as HKT1>::T<<F as HKT1>::T<A>>
where Self: Sized + Traversable<F, <Ap as HKT1>::T<A>, A, TF> + Foldable<F, <Ap as HKT1>::T<A>>, Ap: HKT1, <Ap as HKT1>::T<A>: Applicative<Ap, A> + ApplyOnce<Ap, A>, <Ap as HKT1>::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>, <Ap as HKT1>::T<<F as HKT1>::T<A>>: Applicative<Ap, <F as HKT1>::T<A>> + ApplyOnce<Ap, <F as HKT1>::T<A>>, F: HKT1<T<<Ap as HKT1>::T<A>> = 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<T> Type for T
where T: Class,

Source§

const SIG: Signature = const SIG: Signature = Signature::class(T::PATH);

The signature for this type
Source§

fn jni() -> JavaType

Get the jni rep of this type
Source§

fn is_type_of(e: &mut Env<'_>, o: &JObject<'_>) -> bool

Determines whether an object is an instance of this type
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,