message: Check-in more work migrating JS to Rust
diff: +// Copyright 2020 The NATS Authors
  +// Licensed under the Apache License, Version 2.0 (the "License");
  +// you may not use this file except in compliance with the License.
  +// You may obtain a copy of the License at
  +//
  +// http://www.apache.org/licenses/LICENSE-2.0
  +//
  +// Unless required by applicable law or agreed to in writing, software
  +// distributed under the License is distributed on an "AS IS" BASIS,
  +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  +// See the License for the specific language governing permissions and
  +// limitations under the License.
  +
  #![allow(unused)]
  //! Jetstream support
  use std::{
  @@ -466,23 +479,27 @@ impl Manager {
  /// Stream information.
  pub fn stream_info(&self, stream: String) -> io::Result<StreamInfo> {
  + // func (js *js) StreamInfo(stream string) (*StreamInfo, error) {
  + // csSubj := js.apiSubj(fmt.Sprintf(JSApiStreamInfoT, stream))
  + // r, err := js.nc.Request(csSubj, nil, js.wait)
  + // if err != nil {
  + // return nil, err
  + // }
  + // var resp JSApiStreamInfoResponse
  + // if err := json.Unmarshal(r.Data, &resp); err != nil {
  + // return nil, err
  + // }
  + // if resp.Error != nil {
  + // return nil, errors.New(resp.Error.Description)
  + // }
  + // return resp.StreamInfo, nil
  + // }
  +
  todo!()
  }
  }
  /*
  -// Copyright 2020 The NATS Authors
  -// Licensed under the Apache License, Version 2.0 (the "License");
  -// you may not use this file except in compliance with the License.
  -// You may obtain a copy of the License at
  -//
  -// http://www.apache.org/licenses/LICENSE-2.0
  -//
  -// Unless required by applicable law or agreed to in writing, software
  -// distributed under the License is distributed on an "AS IS" BASIS,
  -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  -// See the License for the specific language governing permissions and
  -// limitations under the License.
  package nats
  @@ -1388,22 +1405,6 @@ type JSApiStreamCreateResponse struct {
  type JSApiStreamInfoResponse = JSApiStreamCreateResponse
  -func (js *js) StreamInfo(stream string) (*StreamInfo, error) {
  - csSubj := js.apiSubj(fmt.Sprintf(JSApiStreamInfoT, stream))
  - r, err := js.nc.Request(csSubj, nil, js.wait)
  - if err != nil {
  - return nil, err
  - }
  - var resp JSApiStreamInfoResponse
  - if err := json.Unmarshal(r.Data, &resp); err != nil {
  - return nil, err
  - }
  - if resp.Error != nil {
  - return nil, errors.New(resp.Error.Description)
  - }
  - return resp.StreamInfo, nil
  -}
  -
  const (
  limitsPolicyString = "limits"
  