//! RPC mode markers

use std::marker::PhantomData;

#[derive(Debug)]
pub struct Unary<A, B = ()>(PhantomData<fn(A) -> B>);

#[derive(Debug)]
pub struct ServerStream<A, B = ()>(PhantomData<fn(A) -> B>);

#[derive(Debug)]
pub struct ClientStream<A, B = ()>(PhantomData<fn(A) -> B>);

#[derive(Debug)]
pub struct BidiStream<A, B = ()>(PhantomData<fn(A) -> B>);

#[derive(Debug)]
pub struct Event<A, B = ()>(PhantomData<fn(A) -> B>);

impl<A, B> Unary<A, B> {
    pub const fn new() -> Self {
        Self(PhantomData)
    }
}

impl<A, B> ServerStream<A, B> {
    pub const fn new() -> Self {
        Self(PhantomData)
    }
}

impl<A, B> ClientStream<A, B> {
    pub const fn new() -> Self {
        Self(PhantomData)
    }
}

impl<A, B> BidiStream<A, B> {
    pub const fn new() -> Self {
        Self(PhantomData)
    }
}

impl<A, B> Event<A, B> {
    pub const fn new() -> Self {
        Self(PhantomData)
    }
}

impl<A, B> Clone for Unary<A, B> {
    fn clone(&self) -> Self {
        *self
    }
}

impl<A, B> Clone for ServerStream<A, B> {
    fn clone(&self) -> Self {
        *self
    }
}

impl<A, B> Clone for ClientStream<A, B> {
    fn clone(&self) -> Self {
        *self
    }
}

impl<A, B> Clone for BidiStream<A, B> {
    fn clone(&self) -> Self {
        *self
    }
}

impl<A, B> Clone for Event<A, B> {
    fn clone(&self) -> Self {
        *self
    }
}

impl<A, B> Copy for Unary<A, B> {}

impl<A, B> Copy for ServerStream<A, B> {}

impl<A, B> Copy for ClientStream<A, B> {}

impl<A, B> Copy for BidiStream<A, B> {}

impl<A, B> Copy for Event<A, B> {}

impl<A, B> Default for Unary<A, B> {
    fn default() -> Self {
        Self::new()
    }
}

impl<A, B> Default for ServerStream<A, B> {
    fn default() -> Self {
        Self::new()
    }
}

impl<A, B> Default for ClientStream<A, B> {
    fn default() -> Self {
        Self::new()
    }
}

impl<A, B> Default for BidiStream<A, B> {
    fn default() -> Self {
        Self::new()
    }
}

impl<A, B> Default for Event<A, B> {
    fn default() -> Self {
        Self::new()
    }
}
