QGrpcCallOptions Class

QGrpcCallOptions 클래스는 개별 RPC를 미세 조정할 수 있는 다양한 옵션을 제공합니다. 더 보기...

Header: #include <QGrpcCallOptions>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
이후 Qt 6.6
QML에서: GrpcCallOptions

공용 함수

QGrpcCallOptions()
QGrpcCallOptions(const QGrpcCallOptions &other)
QGrpcCallOptions(QGrpcCallOptions &&other)
~QGrpcCallOptions()
std::optional<std::chrono::milliseconds> deadlineTimeout() const
QHash<QByteArray, QByteArray> metadata() &&
const QHash<QByteArray, QByteArray> &metadata() const &
QGrpcCallOptions &setDeadlineTimeout(std::chrono::milliseconds timeout)
QGrpcCallOptions &setMetadata(QHash<QByteArray, QByteArray> &&metadata)
QGrpcCallOptions &setMetadata(const QHash<QByteArray, QByteArray> &metadata)
(since 6.8) void swap(QGrpcCallOptions &other)
(since 6.8) QVariant operator QVariant() const
QGrpcCallOptions &operator=(QGrpcCallOptions &&other)
QGrpcCallOptions &operator=(const QGrpcCallOptions &other)
(since 6.8) QDebug operator<<(QDebug debug, const QGrpcCallOptions &callOpts)

상세 설명

QGrpcCallOptions를 사용하면 개별 원격 프로시저 호출(RPC)을 사용자 지정할 수 있습니다. 생성된 클라이언트 인터페이스는 QGrpcCallOptions를 전달하기 위한 액세스 포인트를 제공합니다. 이러한 옵션은 QGrpcChannelOptions 을 통해 설정된 옵션을 대체합니다.

RPC가 공유하는 기본 옵션을 구성하려면 QGrpcChannelOptions 을 사용합니다.

멤버 함수 문서

QGrpcCallOptions &QGrpcCallOptions::setMetadata(QHash<QByteArray, QByteArray> &&metadata)

QGrpcCallOptions &QGrpcCallOptions::setMetadata(const QHash<QByteArray, QByteArray> &metadata)

특정 RPC에 대해 metadata 클라이언트를 설정하고 업데이트된 객체에 대한 참조를 반환합니다.

QGrpcHttp2Channel 메타데이터를 적절한 HTTP/2 헤더로 변환하여 HTTP/2 요청에 추가합니다.

참고: 이 필드를 설정하면 특정 RPC에 대해 QGrpcChannelOptions::setMetadata()가 설정한 값을 재정의합니다.

QHash<QByteArray, QByteArray> QGrpcCallOptions::metadata() &&

[noexcept] const QHash<QByteArray, QByteArray> &QGrpcCallOptions::metadata() const &

특정 RPC에 대한 클라이언트 메타데이터를 반환합니다. 이 필드가 설정되지 않은 경우 빈 메타데이터를 반환합니다.

QGrpcCallOptions::QGrpcCallOptions()

기본값 - 빈 QGrpcCallOptions을 생성합니다.

QGrpcCallOptions::QGrpcCallOptions(const QGrpcCallOptions &other)

other 에서 QGrpcCallOptions 를 복사하여 구성합니다.

[noexcept] QGrpcCallOptions::QGrpcCallOptions(QGrpcCallOptions &&other)

Move는 other 에서 새 QGrpcCallOptions을 생성합니다.

참고: 이동한 개체 other 는 부분적으로 형성된 상태로 배치되며, 유효한 작업은 소멸과 새 값 할당뿐입니다.

[noexcept] QGrpcCallOptions::~QGrpcCallOptions()

QGrpcCallOptions 를 파괴합니다.

[noexcept] std::optional<std::chrono::milliseconds> QGrpcCallOptions::deadlineTimeout() const

특정 RPC의 마감일을 계산하는 데 사용되는 시간 초과 기간을 반환합니다.

이 필드가 설정되지 않은 경우 빈 std::optional 을 반환합니다.

setDeadlineTimeout()도 참조하세요 .

QGrpcCallOptions &QGrpcCallOptions::setDeadlineTimeout(std::chrono::milliseconds timeout)

특정 RPC에 대해 timeout 을 설정하고 업데이트된 객체에 대한 참조를 반환합니다.

기한은 클라이언트가 서버의 응답을 기다릴 수 있는 기간의 제한을 설정합니다. 실제 기한은 RPC의 시작 시간에 timeout 을 더하여 계산됩니다.

기한은 이전에 시작된 호출에 대한 최종 QGrpcStatus 수신을 포함하여 RPC의 전체 수명에 적용되므로 (수명이 긴) 스트림에는 원하지 않을 수 있습니다.

참고: 이 필드를 설정하면 특정 RPC에 대해 QGrpc채널옵션::setDeadline()으로 설정한 값을 재정의합니다.

deadlineTimeout()도 참조하세요 .

[noexcept, since 6.8] void QGrpcCallOptions::swap(QGrpcCallOptions &other)

other 를 이 객체로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.

이 함수는 Qt 6.8에 도입되었습니다.

[since 6.8] QVariant QGrpcCallOptions::operator QVariant() const

이 객체에서 새 QVariant 을 만듭니다.

이 함수는 Qt 6.8에 도입되었습니다.

[noexcept] QGrpcCallOptions &QGrpcCallOptions::operator=(QGrpcCallOptions &&other)

이동 - other 을 이 QGrpcCallOptions 에 할당하고 업데이트된 객체에 대한 참조를 반환합니다.

참고: 이동된 other 객체는 부분적으로 형성된 상태로 배치되며, 유효한 작업은 파괴와 새 값 할당뿐입니다.

QGrpcCallOptions &QGrpcCallOptions::operator=(const QGrpcCallOptions &other)

other 을 이 QGrpcCallOptions 에 할당하고 업데이트된 객체에 대한 참조를 반환합니다.

관련 비회원

[since 6.8] QDebug operator<<(QDebug debug, const QGrpcCallOptions &callOpts)

callOpts 을 지정된 스트림 debug 에 씁니다.

이 함수는 Qt 6.8에 도입되었습니다.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.